Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jifricherur's avatar

mismatching between middleware and route

i am new in forum. here i am traying to authenticate, clear cache and not to return into dashboard without re-signing in Laravel 11 but i am failing. now that i deleted middleware routing then no error but the signing page existing. when signing with other credentials that the previous credential has been loaded. how to solve this conflict, can anyone help me routes: Route::group(['middleware' => ['Nocache']],( function(){ Route::post('save/contactmsg', [SaveController::class,'contactmsg'])->name ('contactmsg'); Route::post('pages/save', [SaveController::class,'saverate'])->name ('save'); Route::post('save/searchresult',[SearchController::class,'searchfun']); Route::post('save/register', [SaveController::class, 'registerfun'])->name('save.register'); Route::post('/save/userlogged',[UserController::class, 'userlogged'])->name('save.userlogged'); Route::post('logout',[UserController::class, 'userlogout'])->name('logout'); }) );

middleware:

headers->set('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate') ->headers->set('Pragma', 'no-cache') ->headers->set('Expires', 'Fri, 01 Jan 1970 00:00:00 GMT'); } } RouteServiceProvider: by($request->user()?->id ?: $request->ip()); }); $this->routes(function () { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.php')); Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/user.php')); Route::middleware('Nocache') ->namespace($this->namespace) ->group(base_path('app\Http\Middleware\Nocache.php')); }); } } Error: lluminate\Contracts\Container\BindingResolutionException Target class [Nocache] does not exist.

0 likes
1 reply

Please or to participate in this conversation.