How to get current route name in Laravel?

Posted by LaravelIndia - 1 year ago

Example 1: Using Request:

$getCurrentRoureName = Request::route()->getName());
dump($getCurrentRoureName);

Example 2: Using Route:

$getCurrentRoureName = Route::getCurrentRoute()->getPath();
dump($getCurrentRoureName);