I'm applying Litespeed cache on our website and I need to use parameter value from route when calling lstag
middleware.
I've already tried using
Route::getCurrentRoute()->parameter('slug');
Request->route()->paremeter('slug');
Request::route('route.name')->parameter('slug');
and everything else I could find on the Internet, but nothing was working. It just throwed error In web.php line 103:
Call to a member function parameter() on null
My full code for route is
Route::get('serialy/{slug}', 'SerialsController@show')->name('serials.show')->middleware('lstag:serial.' . Route::getCurrentRoute()->parameter('slug'));
I expect that I can use a value of parameter when calling a route middleware (lstag), but I can't find any way to do it. Is it even possible?