How to get route method name in Laravel

Updated 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