mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-02-15 04:48:14 -05:00
fix(plugin): remove redundant code
This commit is contained in:
parent
0f903dacf6
commit
0232bb90dc
@ -7,6 +7,7 @@ use App\Services\Plugin\PluginManager;
|
|||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class PluginServiceProvider extends ServiceProvider
|
class PluginServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
@ -19,23 +20,8 @@ class PluginServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!file_exists(base_path('plugins'))) {
|
if (!file_exists(base_path('plugins'))) {
|
||||||
mkdir(base_path('plugins'), 0755, true);
|
mkdir(base_path('plugins'), 0755, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
$plugins = Plugin::query()
|
|
||||||
->where('is_enabled', true)
|
|
||||||
->get();
|
|
||||||
|
|
||||||
foreach ($plugins as $plugin) {
|
|
||||||
$manager = $this->app->make(PluginManager::class);
|
|
||||||
$manager->enable($plugin->code);
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
\Log::error('Failed to load plugins: ' . $e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user