From 7c8454276e45cf031344cf9b3c321d62d8440b61 Mon Sep 17 00:00:00 2001 From: Boy132 Date: Sat, 2 Aug 2025 00:34:50 +0200 Subject: [PATCH] make name & author optional in create plugin command --- app/Console/Commands/Plugin/CreatePluginCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/Plugin/CreatePluginCommand.php b/app/Console/Commands/Plugin/CreatePluginCommand.php index 5418ed898..a10680c11 100644 --- a/app/Console/Commands/Plugin/CreatePluginCommand.php +++ b/app/Console/Commands/Plugin/CreatePluginCommand.php @@ -9,8 +9,8 @@ use Illuminate\Filesystem\Filesystem; class CreatePluginCommand extends Command { protected $signature = 'p:plugin:create - {name} - {author} + {--name=} + {--author=} {--description=} {--category=} {--url=} @@ -27,7 +27,7 @@ class CreatePluginCommand extends Command public function handle(): void { - $name = $this->argument('name'); + $name = $this->option('name') ?? $this->ask('Name'); $id = str_slug(strtolower($name)); if ($this->filesystem->exists(plugin_path($id))) { @@ -36,7 +36,7 @@ class CreatePluginCommand extends Command return; } - $author = $this->argument('author'); + $author = $this->option('$author') ?? $this->ask('$author'); $namespace = $author . '\\' . studly_case($name); $class = studly_case($name . 'Plugin');