Open boyteenphonui opened 6 years ago
Did you succeed? I would also like to use both together.
All advice is welcome here.
I'll keep you posted on my progress here.
Any updates here?
I also use both, to be able to use I created my own command to help me, but I have to keep migrating.
So I came in issues to make this request but the project is already quite crowded, I will continue migrating in the hand kkkk Detail if there are many people with this issue, I create a pull, to be able to solve the problem
namespace Modules\Sistema\Console;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class CreateRepositoryCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'module:make-repository';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Criando repository';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
if(!\Module::has($this->argument('modulo'))):
return $this->error('O modulo solicitado não foi localizado');
endif;
$basePath = \Module::find($this->argument('modulo'));
\Config::set('repository.generator.basePath', $basePath->getPath());
\Config::set('repository.generator.rootNamespace', "Modules\\{$basePath->getName()}\\");
\Config::set('repository.generator.stubsOverridePath', $basePath->getPath());
Artisan::call('make:repository', [
'name' => $this->argument('repositorio')
]);
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['repositorio', InputArgument::REQUIRED, 'Qual o repositorio que será criado'],
['modulo', InputArgument::REQUIRED, 'Em qual modulo será instalado'],
];
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [];
}
}
I have many modules Module Article, Product, I use package https://github.com/nWidart/laravel-modules
How To generate everything by command artisan. For the module Article, Product ...
Thanks !