Skip to content

Commit d1a77a1

Browse files
Configure Jetstream classes in providers and separate panels into Admin and App
1 parent 58af860 commit d1a77a1

File tree

1 file changed

+1
-55
lines changed

1 file changed

+1
-55
lines changed

app/Providers/Filament/AdminPanelProvider.php

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace App\Providers\Filament;
44

55
use App\Filament\Admin\Pages;
6-
use App\Filament\Admin\Pages\EditProfile;
76
use App\Http\Middleware\TeamsPermission;
87
use App\Listeners\CreatePersonalTeam;
98
use App\Listeners\SwitchTeam;
@@ -43,26 +42,16 @@ public function panel(Panel $panel): Panel
4342
->id('admin')
4443
->path('admin')
4544
->login([AuthenticatedSessionController::class, 'create'])
46-
->registration([RegisteredUserController::class, 'create'])
4745
->passwordReset()
4846
->emailVerification()
4947
->viteTheme('resources/css/Filament/Admin/theme.css')
5048
->colors([
5149
'primary' => Color::Gray,
5250
])
53-
->userMenuItems([
54-
MenuItem::make()
55-
->label('Profile')
56-
->icon('heroicon-o-user-circle')
57-
->url(fn () => $this->shouldRegisterMenuItem()
58-
? url(EditProfile::getUrl())
59-
: url($panel->getPath())),
60-
])
6151
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources')
6252
->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages')
6353
->pages([
64-
FilamentPage\Dashboard::class,
65-
Pages\EditProfile::class,
54+
Filament\Page\Dashboard::class,
6655
])
6756
->discoverWidgets(in: app_path('Filament/Admin/Widgets/Home'), for: 'App\\Filament\\Admin\\Widgets\\Home')
6857
->widgets([
@@ -82,39 +71,11 @@ public function panel(Panel $panel): Panel
8271
])
8372
->authMiddleware([
8473
Authenticate::class,
85-
TeamsPermission::class,
8674
])
8775
->plugins([
8876
\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make()
8977
]);
9078

91-
if (Features::hasApiFeatures()) {
92-
$panel->userMenuItems([
93-
MenuItem::make()
94-
->label('API Tokens')
95-
->icon('heroicon-o-key')
96-
->url(fn () => $this->shouldRegisterMenuItem()
97-
? url(Pages\ApiTokenManagerPage::getUrl())
98-
: url($panel->getPath())),
99-
]);
100-
}
101-
102-
if (Features::hasTeamFeatures()) {
103-
$panel
104-
->tenant(Team::class, ownershipRelationship: 'team')
105-
->tenantRegistration(Pages\CreateTeam::class)
106-
->tenantProfile(Pages\EditTeam::class)
107-
->userMenuItems([
108-
MenuItem::make()
109-
->label('Team Settings')
110-
->icon('heroicon-o-cog-6-tooth')
111-
->url(fn () => $this->shouldRegisterMenuItem()
112-
? url(Pages\EditTeam::getUrl())
113-
: url($panel->getPath())),
114-
]);
115-
}
116-
117-
return $panel;
11879
}
11980

12081
public function boot()
@@ -129,21 +90,6 @@ public function boot()
12990
*/
13091
Jetstream::$registersRoutes = false;
13192

132-
/**
133-
* Listen and create personal team for new accounts.
134-
*/
135-
Event::listen(
136-
Registered::class,
137-
CreatePersonalTeam::class,
138-
);
139-
140-
/**
141-
* Listen and switch team if tenant was changed.
142-
*/
143-
Event::listen(
144-
TenantSet::class,
145-
SwitchTeam::class,
146-
);
14793
}
14894

14995
public function shouldRegisterMenuItem(): bool

0 commit comments

Comments
 (0)