change "id" in install and update commands to argument

This commit is contained in:
Boy132 2025-09-12 11:50:52 +02:00
parent 561aaa3ae0
commit b0e6c51e77
2 changed files with 4 additions and 4 deletions

View File

@ -8,13 +8,13 @@ use Illuminate\Console\Command;
class InstallPluginCommand extends Command
{
protected $signature = 'p:plugin:install {--id=}';
protected $signature = 'p:plugin:install {id?}';
protected $description = 'Installs a plugin';
public function handle(): void
{
$id = $this->option('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
$id = $this->argument('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
/** @var ?Plugin $plugin */
$plugin = Plugin::where('id', $id)->first();

View File

@ -8,13 +8,13 @@ use Illuminate\Console\Command;
class UpdatePluginCommand extends Command
{
protected $signature = 'p:plugin:update {--id=}';
protected $signature = 'p:plugin:update {id?}';
protected $description = 'Updates a plugin';
public function handle(): void
{
$id = $this->option('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
$id = $this->argument('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
/** @var ?Plugin $plugin */
$plugin = Plugin::where('id', $id)->first();