How can get collection of route thats registered in a middleware? In laravel 4.2 I can get collection of filters for each route like this:
$routeCollection = Route::getRoutes();
$filterName = "Visit";
$routeHasFilter = array();
foreach ($routeCollection as $route){
$filters = $route->beforeFilters();
if (count($filters) >= 1) {
$filters = array_keys($filters);
if (in_array($filterName, $filters))
$routeHasFilter[] = $route;
}
}
How can I find routes in laravel 5.1 with middleware?