mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
34
app/Console/Commands/Plugins/LoadPluginsCommand.php
Normal file
34
app/Console/Commands/Plugins/LoadPluginsCommand.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Plugins;
|
||||
|
||||
use App\Facades\Plugins;
|
||||
use Exception;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class LoadPluginsCommand extends Command
|
||||
{
|
||||
protected $signature = 'plugins:load';
|
||||
|
||||
protected $description = 'Load all plugins from the storage/plugins directory';
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
$this->info('Loading plugins...');
|
||||
|
||||
try {
|
||||
Plugins::load();
|
||||
} catch (Exception $e) {
|
||||
$this->output->error($e->getMessage());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Plugins::cleanup();
|
||||
|
||||
$this->info('Plugins loaded successfully.');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user