Get Current Route Name in Laravel (v5 - v7)
In earlier versions of Laravel (v4), the Route::currentRouteName() method could be used to retrieve the current route name. However, from Laravel v5 onwards, this method is no longer available.
Laravel v5
In Laravel v5, you can get the current route name using the following methods:
Laravel v5.2
From Laravel v5.2 onwards, the Route::currentRouteName() method is reintroduced:
Laravel v5.3 - v5.8
In Laravel v5.3 and later:
Laravel v6.x - v7.x
This method remains the same in Laravel v6.x and v7.x:
Using Request
In all versions of Laravel, you can also use the Request object to get the current route name:
Additional Information
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3