blessing-skin-server/app/Console/Commands/PluginDisableCommand.php

26 lines
687 B
PHP
Raw Normal View History

<?php
namespace App\Console\Commands;
use App\Services\PluginManager;
use Illuminate\Console\Command;
2019-08-09 10:13:55 +08:00
class PluginDisableCommand extends Command
{
protected $signature = 'plugin:disable {name}';
protected $description = 'Disable a plugin';
public function handle(PluginManager $plugins)
{
$plugin = $plugins->get($this->argument('name'));
if ($plugin) {
$plugins->disable($this->argument('name'));
$title = trans($plugin->title);
$this->info(trans('admin.plugins.operations.disabled', ['plugin' => $title]));
} else {
$this->warn(trans('admin.plugins.operations.not-found'));
}
}
}