Get Current Route Name Laravel

  • 02-11-2022
  • 740
  • Laravel 9
  • Haresh Chauhan

How to get the current route name or action or route? sometimes developers need to take action based on the fire of the route name. So they need to get the route name or action or many things from the route, so they can action based on the route name. especially when you set up your site permission based on the route that time you must require your route name and based on that route name we can very easily identify the user's permission.

In the previous laravel version and the latest laravel version little bit of to get route name in the application. I have defined the latest version route name and action in this post example.

From the request using the getName() with the route request, you will able to get the current route name. also you can fine the route action name and file location.

Routing names and actions will help the developer for finding the file location and file path from start to end. can easy to find the controller name and action as well. So in this, you will able to find the ROUTE name, action, and current route name. also this post gives how to fallback routes when not reaching the path in your application routes.

How to get current route name?
How to get current route name or action or route?
# Get current route
$route = Route::current();

# get current route name
$name = Route::currentRouteName();

# get current route controller action
$action = Route::currentRouteAction();
How to define 404 route?
# Define not found route

# Define 404 route without controller
Route::fallback(function () {
     return view("404");

Route Resource Controller Laravel

Laravel cache clear from view, config, route, and all cache data from application

Laravel Routing Multiple Method Use In Single Route

How To Pass Route Params And Get Route Params From The URL In Vue Js

The GET method is not supported for this route. Supported methods: PATCH

Create Custom Route File With New Service Provider Laravel 8 9

We always thanks to you for reading our blogs.


Dharmesh Chauhan

(Swapinfoway Founder)

Hello Sir, We are brothers origin from Gujarat India, Fullstack developers working together since 2016. We have lots of skills in web development in different technologies here I mention PHP, Laravel, Javascript, Vuejs, Ajax, API, Payment Gateway Integration, Database, HTML5, CSS3, and Server Administration. So you need our service Please Contact Us


Haresh Chauhan


We Are Also Recommending You :