In short, You looking to have the Auth::user() data sent even in 404 pages in Laravel 11?
Try using the Route::fallback
method. Use a controller or a callback function to load your custom 404 page and in this way, you will have access to auth()->user()
.
Route::fallback(function () {
return view('errors.404');
});
Its simple are anyone to apply this code laravel php new version laravel 11 .I’m sure problem will be solved.
Discver more problem question by visiting laravel 11
Leave a Reply