-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add PublicPanelProvider for public pages con
- Loading branch information
1 parent
e91fd9e
commit 46a5c2b
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace App\Providers\Filament; | ||
|
||
use Filament\Panel; | ||
use Filament\PanelProvider; | ||
use Filament\Support\Colors\Color; | ||
use Filament\Http\Middleware\Authenticate; | ||
use Filament\Http\Middleware\DisableBladeIconComponents; | ||
use Filament\Http\Middleware\DispatchServingFilamentEvent; | ||
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; | ||
use Illuminate\Cookie\Middleware\EncryptCookies; | ||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; | ||
use Illuminate\Routing\Middleware\SubstituteBindings; | ||
use Illuminate\Session\Middleware\AuthenticateSession; | ||
use Illuminate\Session\Middleware\StartSession; | ||
use Illuminate\View\Middleware\ShareErrorsFromSession; | ||
|
||
class PublicPanelProvider extends PanelProvider | ||
{ | ||
public function panel(Panel $panel): Panel | ||
{ | ||
return $panel | ||
->default() | ||
->id('public') | ||
->path('') | ||
->login() | ||
->registration() | ||
->passwordReset() | ||
->emailVerification() | ||
->colors([ | ||
'primary' => Color::Amber, | ||
]) | ||
->discoverResources(in: app_path('Filament/Resources/Public'), for: 'App\\Filament\\Resources\\Public') | ||
->discoverPages(in: app_path('Filament/Pages/Public'), for: 'App\\Filament\\Pages\\Public') | ||
->discoverWidgets(in: app_path('Filament/Widgets/Public'), for: 'App\\Filament\\Widgets\\Public') | ||
->middleware([ | ||
EncryptCookies::class, | ||
AddQueuedCookiesToResponse::class, | ||
StartSession::class, | ||
AuthenticateSession::class, | ||
ShareErrorsFromSession::class, | ||
VerifyCsrfToken::class, | ||
SubstituteBindings::class, | ||
DisableBladeIconComponents::class, | ||
DispatchServingFilamentEvent::class, | ||
]) | ||
->authMiddleware([ | ||
Authenticate::class, | ||
]); | ||
} | ||
} |