mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 15:32:35 +00:00
29
app/Console/Commands/Plugins/UninstallPluginCommand.php
Normal file
29
app/Console/Commands/Plugins/UninstallPluginCommand.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Plugins;
|
||||
|
||||
use App\Facades\Plugins;
|
||||
use Exception;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class UninstallPluginCommand extends Command
|
||||
{
|
||||
protected $signature = 'plugins:uninstall {name}';
|
||||
|
||||
protected $description = 'Uninstall a plugin by name';
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$this->info('Uninstalling '.$this->argument('name').'...');
|
||||
|
||||
try {
|
||||
Plugins::uninstall($this->argument('name'));
|
||||
} catch (Exception $e) {
|
||||
$this->output->error($e->getMessage());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->info('Plugin uninstalled successfully.');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user