bug fix
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Filament\Notifications\Notification;
|
||||
use Illuminate\Http\Request;
|
||||
use Joaopaulolndev\FilamentEditProfile\Pages\EditProfilePage;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -26,7 +27,7 @@ class EnsureProfileIsFilled
|
||||
}
|
||||
|
||||
// 3. Define the 'safe' routes
|
||||
$profilePageClass = EditProfilePage::class; // <-- !! IMPORTANT: Change to your page
|
||||
$profilePageClass = EditProfilePage::class;
|
||||
$profilePageUrl = $profilePageClass::getUrl();
|
||||
|
||||
/** @var \Filament\Panel */
|
||||
@@ -53,6 +54,12 @@ class EnsureProfileIsFilled
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
Notification::make()
|
||||
->danger()
|
||||
->title(__('Please update your profile'))
|
||||
->color('danger')
|
||||
->send();
|
||||
|
||||
// 6. If not, redirect them to the profile page.
|
||||
// Filament's SPA mode will intercept this 302 redirect
|
||||
// and navigate without a full page reload.
|
||||
|
||||
Reference in New Issue
Block a user