diff --git a/src/Concerns/ConfirmsFilament.php b/src/Concerns/ConfirmsFilament.php index 1b5e045..faf83da 100644 --- a/src/Concerns/ConfirmsFilament.php +++ b/src/Concerns/ConfirmsFilament.php @@ -39,12 +39,12 @@ public function cameFromFilamentAuthRoute(): bool { $previousRoute = Session::get('socialstream.previous_url'); - return in_array($previousRoute, [ - route('filament.auth.login'), - route('filament.admin.auth.login'), - route('filament.auth.register'), - route('filament.admin.auth.register'), - ]); + return in_array($previousRoute, array_filter([ + Route::has('filament.auth.login') ? route('filament.auth.login') : null, + Route::has('filament.admin.auth.login') ? route('filament.admin.auth.login') : null, + Route::has('filament.auth.register') ? route('filament.auth.register') : null, + Route::has('filament.admin.auth.register') ? route('filament.admin.auth.register') : null, + ])); } public function hasFilamentLoginRoutes(): bool