style updates
This commit is contained in:
@@ -9,15 +9,24 @@ use Throwable;
|
||||
final class MakeCrudCommand extends Command
|
||||
{
|
||||
protected $signature = 'crud:make {model} {--module=} {--force}';
|
||||
|
||||
protected $description = 'Generate model, migration, request, controller, views and test inside a module.';
|
||||
|
||||
public function handle(CrudGenerator $generator): int
|
||||
{
|
||||
$module = $this->option('module') ?: $this->choice('Select the target module', $this->modules());
|
||||
try { $files = $generator->generate((string) $module, $this->argument('model'), (bool) $this->option('force')); }
|
||||
catch (Throwable $e) { $this->error($e->getMessage()); return self::FAILURE; }
|
||||
foreach ($files as $file) { $this->line("<info>created</info> {$file}"); }
|
||||
try {
|
||||
$files = $generator->generate((string) $module, $this->argument('model'), (bool) $this->option('force'));
|
||||
} catch (Throwable $e) {
|
||||
$this->error($e->getMessage());
|
||||
|
||||
return self::FAILURE;
|
||||
}
|
||||
foreach ($files as $file) {
|
||||
$this->line("<info>created</info> {$file}");
|
||||
}
|
||||
$this->warn('Register the generated controller routes in the target module Routes/web.php file.');
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user