Originally posted @ https://codeanddeploy.com visit and download the sample code: https://codeanddeploy.com/blog/laravel/laravel-8-how-to-get-routes-in-controller In this post, I will share how to get the Laravel 8 routes inside a controller. If you need to get the routes and register them to your permissions then this is for you or maybe another checking you need in your Laravel project.

* * @return \Illuminate\Http\Response */ public function index() { $routes = Route::getRoutes(); foreach ($routes->getRoutes() as $route) { echo $route->getName(). ' '; echo $route->getActionName(). '

Kindly visit here https://codeanddeploy.com/blog/laravel/laravel-8-how-to-get-routes-in-controller if you want to download this code.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners