I am trying to access the middlewares applied for a specific route. I'm getting the middleware for current route, but not for a specific route other than current.
This will return middleware of current route
\Illuminate\Support\Facades\Route::getFacadeRoot()->current()->computedMiddleware;
I want to access the middleware of this route
\Illuminate\Support\Facades\Route::getRoutes()->getByName('task_details');
The computedMiddleware of this route returns null. I applied a couple of middlewares for this route.
Anyone have any idea about this?. Or anyother workarounds?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire