How to get route method name in Laravel

Created at 05-Oct-2021 , By samar

How to get route method name in Laravel

We will use programming in this lesson to attempt to solve the "How to get route method name in Laravel".

You can get route method name in Laravel using method() method on request() in Laravel. You can simply use request() helper method in controller or view file to get the method (GET/POST/PUT/PATCH/DELETE) of route in Laravel
  • Get route method on visit url in laravel

    request()->method()
    

    Output:

    GET

    It helps you to get the method of route in laravel. You can use code snippet in routes\web.php, controller and view file.

Back to code snippet queries related laravel

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.