Laravel: How to Get Current Route Name? (v5 … v7)

Try this Route::getCurrentRoute()->getPath(); or \Request::route()->getName() from v5.1 use Illuminate\Support\Facades\Route; $currentPath= Route::getFacadeRoot()->current()->uri(); Laravel v5.2 Route::currentRouteName(); //use Illuminate\Support\Facades\Route; Or if you need the action name Route::getCurrentRoute()->getActionName(); Laravel 5.2 route documentation Retrieving The Request URI The path method returns the request’s URI. So, if the incoming request is targeted at http://example.com/foo/bar, the path method will return foo/bar: $uri … Read more