Files
laralog/app/Providers/AppServiceProvider.php
T

50 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace App\Providers;
use Filament\Facades\Filament;
use Filament\View\PanelsRenderHook;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
// 自动加载所有插件的迁移(插件目录下 database/migrations
foreach (glob(base_path('plugins/*/database/migrations')) ?: [] as $path) {
$this->loadMigrationsFrom($path);
}
// 后台侧边栏紧凑化(更窄的菜单项)
Filament::serving(function () {
Filament::registerRenderHook(
PanelsRenderHook::STYLES_AFTER,
fn () => Blade::render(<<<'HTML'
<style>
.fi-sidebar { padding-inline: 0.75rem; }
.fi-sidebar-nav { padding-inline: 0; }
.fi-sidebar-nav .fi-sidebar-item-button { padding-inline: 0.6rem; border-radius: 0.5rem; }
.fi-sidebar-nav .fi-sidebar-item-label { font-size: 0.82rem; }
.fi-sidebar-nav .fi-sidebar-group-label { font-size: 0.68rem; letter-spacing: 0.04em; }
.fi-sidebar-brand { padding-block: 0.9rem; }
</style>
HTML)
);
});
}
}