From 966b8dff3240f8da09d0e8650b3f708249d378f8 Mon Sep 17 00:00:00 2001 From: Joel Butcher Date: Thu, 25 Jul 2024 09:47:50 +0100 Subject: [PATCH] [6.x] Fix `ConfirmsFilament` trait (#365) * fix trait * simplify approach --- src/Concerns/ConfirmsFilament.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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