mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 12:39:30 +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 $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
|
public function handle(): void
|
||||||
{
|
{
|
||||||
|
|||||||
@ -8,14 +8,16 @@ use Illuminate\Console\Command;
|
|||||||
|
|
||||||
class InstallPluginCommand extends Command
|
class InstallPluginCommand extends Command
|
||||||
{
|
{
|
||||||
protected $signature = 'p:plugin:install {id}';
|
protected $signature = 'p:plugin:install {--id=}';
|
||||||
|
|
||||||
protected $description = 'Installs a plugin';
|
protected $description = 'Installs a plugin';
|
||||||
|
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
|
$id = $this->option('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
|
||||||
|
|
||||||
/** @var ?Plugin $plugin */
|
/** @var ?Plugin $plugin */
|
||||||
$plugin = Plugin::where('id', $this->argument('id'))->first();
|
$plugin = Plugin::where('id', $id)->first();
|
||||||
|
|
||||||
if (!$plugin) {
|
if (!$plugin) {
|
||||||
$this->error('Plugin does not exist!');
|
$this->error('Plugin does not exist!');
|
||||||
|
|||||||
@ -8,14 +8,16 @@ use Illuminate\Console\Command;
|
|||||||
|
|
||||||
class UpdatePluginCommand extends Command
|
class UpdatePluginCommand extends Command
|
||||||
{
|
{
|
||||||
protected $signature = 'p:plugin:update {id}';
|
protected $signature = 'p:plugin:update {--id=}';
|
||||||
|
|
||||||
protected $description = 'Updates a plugin';
|
protected $description = 'Updates a plugin';
|
||||||
|
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
|
$id = $this->option('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
|
||||||
|
|
||||||
/** @var ?Plugin $plugin */
|
/** @var ?Plugin $plugin */
|
||||||
$plugin = Plugin::where('id', $this->argument('id'))->first();
|
$plugin = Plugin::where('id', $id)->first();
|
||||||
|
|
||||||
if (!$plugin) {
|
if (!$plugin) {
|
||||||
$this->error('Plugin does not exist!');
|
$this->error('Plugin does not exist!');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user