How to get current route name in Laravel?

Posted by LaravelIndia - 6 months ago

Example 1: Using Request:

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

Example 2: Using Route:

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