Skip to content

Commit b06777e

Browse files
committed
Change Navigation item to MenuItem and added a MenuItem on the admin side
1 parent 77eff80 commit b06777e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
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
{
@@ -44,6 +45,13 @@ public function panel(Panel $panel): Panel
4445
->brandLogo(config('app.logo'))
4546
->brandLogoHeight('2rem')
4647
->profile(EditProfile::class, false)
48+
->userMenuItems([
49+
MenuItem::make()
50+
->label('Exit Admin')
51+
->url('/app')
52+
->icon('tabler-arrow-back')
53+
->sort(24),
54+
])
4755
->colors([
4856
'danger' => Color::Red,
4957
'gray' => Color::Zinc,

app/Providers/Filament/AppPanelProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Illuminate\Session\Middleware\AuthenticateSession;
2222
use Illuminate\Session\Middleware\StartSession;
2323
use Illuminate\View\Middleware\ShareErrorsFromSession;
24+
use Filament\Navigation\MenuItem;
2425

2526
class AppPanelProvider extends PanelProvider
2627
{
@@ -52,10 +53,9 @@ public function panel(Panel $panel): Panel
5253
->pages([
5354
//Pages\Dashboard::class,
5455
])
55-
->navigationItems([
56-
NavigationItem::make('admin')
56+
->userMenuItems([
57+
MenuItem::make()
5758
->label('Admin')
58-
->group('Admin') // TODO find a better name for this
5959
->url('/admin')
6060
->icon('tabler-arrow-forward')
6161
->sort(5)

0 commit comments

Comments
 (0)