This commit is contained in:
Mark Gregory
2026-07-24 11:52:58 +01:00
parent 88dda2a883
commit 979ae2421e
19 changed files with 435 additions and 1 deletions
@@ -0,0 +1,22 @@
<?php
namespace Modules\Developer\Console\Commands;
use Illuminate\Console\Command;
use Modules\Developer\Support\ModuleGenerator;
use Throwable;
final class MakeModuleCommand extends Command
{
protected $signature = 'module:make {name} {--force}';
protected $description = 'Generate a complete modular Laravel module scaffold.';
public function handle(ModuleGenerator $generator): int
{
try { $files = $generator->generate($this->argument('name'), (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->newLine(); $this->info('Enable the module in modules_statuses.json, then run composer dump-autoload.');
return self::SUCCESS;
}
}