lundi 25 septembre 2017

Access Middle-ware applied for a given route Laravel 5.4

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?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2xEt0FV
via IFTTT

Aucun commentaire:

Enregistrer un commentaire