diff --git a/src/Laravel/src/Commands/MakeResourceCommand.php b/src/Laravel/src/Commands/MakeResourceCommand.php index 23fb46096..00ed064bc 100644 --- a/src/Laravel/src/Commands/MakeResourceCommand.php +++ b/src/Laravel/src/Commands/MakeResourceCommand.php @@ -13,7 +13,7 @@ #[AsCommand(name: 'moonshine:resource')] class MakeResourceCommand extends MoonShineCommand { - protected $signature = 'moonshine:resource {name?} {--m|model=} {--t|title=} {--test} {--pest}'; + protected $signature = 'moonshine:resource {name?} {--m|model=} {--t|title=} {--test} {--pest} {--p|policy}'; protected $description = 'Create resource'; @@ -98,6 +98,12 @@ public function handle(): int $title ); + if($this->option('policy')) { + $this->call(MakePolicyCommand::class, [ + 'className' => class_basename($model), + ]); + } + return self::SUCCESS; } }