mercredi 18 décembre 2019

Laravel get route list by request Type methods

I am using laravel 6.1 . I am trying do dynamic permission for user for add,edit ,delete and view .so trying to get route list from laravel router using following method

$routes = [];

foreach (Route::getRoutes()->getIterator() as $route){

    $routes[] = $route->uri;

}

This will return all route url list but problem here is for paramter routes list it has below

post-detail/{categoryId}/{postid}

How i can compare in middleware whether url is matching to this route .

Also is it possible to get route type along with route list.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire