Skip to content

Commit

Permalink
feat: MakeResourceCommand with policy option
Browse files Browse the repository at this point in the history
Issue #1305
  • Loading branch information
lee-to committed Dec 24, 2024
1 parent 1c6d480 commit 63b849e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Laravel/src/Commands/MakeResourceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -98,6 +98,12 @@ public function handle(): int
$title
);

if($this->option('policy')) {
$this->call(MakePolicyCommand::class, [
'className' => class_basename($model),
]);
}

return self::SUCCESS;
}
}

0 comments on commit 63b849e

Please sign in to comment.