Skip to content

Commit e78db43

Browse files
committed
fix: Pint
feat: MenuItems to and from admin
1 parent 959fa8d commit e78db43

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

app/Providers/Filament/AdminPanelProvider.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Illuminate\Session\Middleware\AuthenticateSession;
2020
use Illuminate\Session\Middleware\StartSession;
2121
use Illuminate\View\Middleware\ShareErrorsFromSession;
22+
use Filament\Navigation\MenuItem;
2223

2324
class AdminPanelProvider extends PanelProvider
2425
{
@@ -43,6 +44,13 @@ public function panel(Panel $panel): Panel
4344
->brandLogo(config('app.logo'))
4445
->brandLogoHeight('2rem')
4546
->profile(EditProfile::class, false)
47+
->userMenuItems([
48+
MenuItem::make()
49+
->label('Exit Admin')
50+
->url('/app')
51+
->icon('tabler-arrow-back')
52+
->sort(24),
53+
])
4654
->colors([
4755
'danger' => Color::Red,
4856
'gray' => Color::Zinc,

app/Providers/Filament/AppPanelProvider.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Illuminate\Session\Middleware\AuthenticateSession;
2121
use Illuminate\Session\Middleware\StartSession;
2222
use Illuminate\View\Middleware\ShareErrorsFromSession;
23+
use Filament\Navigation\MenuItem;
2324

2425
class AppPanelProvider extends PanelProvider
2526
{
@@ -51,6 +52,14 @@ public function panel(Panel $panel): Panel
5152
->pages([
5253
Pages\Dashboard::class,
5354
])
55+
->userMenuItems([
56+
MenuItem::make()
57+
->label('Admin')
58+
->url('/admin')
59+
->icon('tabler-arrow-forward')
60+
->sort(5)
61+
->visible(fn (): bool => auth()->user()->root_admin),
62+
])
5463
->favicon(config('app.favicon', '/pelican.ico'))
5564
->brandName(config('app.name', 'Pelican'))
5665
->brandLogo(config('app.logo'))

pint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"nullable_type_declaration_for_default_null_value": false,
88
"ordered_imports": false,
99
"phpdoc_align": false,
10-
"phpdoc_separation": false
10+
"phpdoc_separation": false,
11+
"single_line_empty_body": false
1112
}
1213
}

0 commit comments

Comments
 (0)