mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-08 10:39:27 +01:00
add choice list to install & update artisan commands
This commit is contained in:
parent
be404a8332
commit
abf6349918
@ -11,7 +11,7 @@ class ComposerPluginsCommand extends Command
|
||||
{
|
||||
protected $signature = 'p:plugin:composer';
|
||||
|
||||
protected $description = 'Runs composer require on all installed plugins.';
|
||||
protected $description = 'Runs "composer require" on all installed plugins.';
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
|
||||
@ -8,14 +8,16 @@ 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());
|
||||
|
||||
/** @var ?Plugin $plugin */
|
||||
$plugin = Plugin::where('id', $this->argument('id'))->first();
|
||||
$plugin = Plugin::where('id', $id)->first();
|
||||
|
||||
if (!$plugin) {
|
||||
$this->error('Plugin does not exist!');
|
||||
|
||||
@ -8,14 +8,16 @@ 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());
|
||||
|
||||
/** @var ?Plugin $plugin */
|
||||
$plugin = Plugin::where('id', $this->argument('id'))->first();
|
||||
$plugin = Plugin::where('id', $id)->first();
|
||||
|
||||
if (!$plugin) {
|
||||
$this->error('Plugin does not exist!');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user