Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Dave Wize's avatar

Method not allowed exeption after dpoing a post request on a post route

This is my route

    Route::post('feedback', function () {
  
    });

And I'm doing a request to domain.test/api/feedback in Postman but I'm getting back this error

Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The GET method is not supported for route api/feedback. Supported methods: POST. in file C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php on line 122

Any clue why this happens? so weird...

0 likes
8 replies
LaryAI's avatar
Level 58

The error message suggests that the request being made is a GET request instead of a POST request. Double-check the request method being used in Postman to ensure that it is a POST request.

If the request method is correct, try clearing the route cache by running the following command in the terminal:

php artisan route:clear

If the issue persists, try renaming the route to something else and see if that resolves the issue.

Route::post('submit-feedback', function () {
  
});

If none of these solutions work, it may be helpful to provide more information about the code and environment being used.

jlrdw's avatar

@Dave Wize are you sure you have it in the correct file, the api routes.

1 like
Ben Taylor's avatar

Are you trying to GET or POST? The route is set for a POST request. But you were doing a GET request in postman

1 like
Snapey's avatar

the error is often caused because you have a validation error, and you did not set the header Accept: application/json

The validation error occurs and instead of getting a json payload, Laravel tries to redirect to a route with the same url but as a get request. By default Postman tries to follow the redirect and then the error you see is thrown

1 like
Dave Wize's avatar

@Snapey Thanks for your reply.

My Accept header was actually on /*/, and I updated it to application/json

But the error is still here.

You might be correct that validation is causing the issue, but I don't know what header can help here. I thought the full error page might be useful to troubleshoot but it is very long. Accept my apologies for that.

{
    "message": "The GET method is not supported for route api/submit-feedback. Supported methods: POST.",
    "exception": "Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException",
    "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php",
    "line": 122,
    "trace": [
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php",
            "line": 107,
            "function": "requestMethodNotAllowed",
            "class": "Illuminate\Routing\AbstractRouteCollection",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php",
            "line": 41,
            "function": "getRouteForMethods",
            "class": "Illuminate\Routing\AbstractRouteCollection",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php",
            "line": 162,
            "function": "handleMatchedRoute",
            "class": "Illuminate\Routing\AbstractRouteCollection",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Routing\Router.php",
            "line": 753,
            "function": "match",
            "class": "Illuminate\Routing\RouteCollection",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Routing\Router.php",
            "line": 740,
            "function": "findRoute",
            "class": "Illuminate\Routing\Router",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Routing\Router.php",
            "line": 729,
            "function": "dispatchToRoute",
            "class": "Illuminate\Routing\Router",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php",
            "line": 200,
            "function": "dispatch",
            "class": "Illuminate\Routing\Router",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 141,
            "function": "Illuminate\Foundation\Http\{closure}",
            "class": "Illuminate\Foundation\Http\Kernel",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\livewire\livewire\src\DisableBrowserCache.php",
            "line": 19,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "Livewire\DisableBrowserCache",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\barryvdh\laravel-debugbar\src\Middleware\InjectDebugbar.php",
            "line": 66,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "Barryvdh\Debugbar\Middleware\InjectDebugbar",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull.php",
            "line": 31,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\TransformsRequest",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\app\Http\Middleware\HandleNull.php",
            "line": 25,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "App\Http\Middleware\HandleNull",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TrimStrings.php",
            "line": 40,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\TransformsRequest",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\TrimStrings",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ValidatePostSize.php",
            "line": 27,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\ValidatePostSize",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance.php",
            "line": 86,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Http\Middleware\HandleCors.php",
            "line": 62,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "Illuminate\Http\Middleware\HandleCors",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Http\Middleware\TrustProxies.php",
            "line": 39,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 180,
            "function": "handle",
            "class": "Illuminate\Http\Middleware\TrustProxies",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php",
            "line": 116,
            "function": "Illuminate\Pipeline\{closure}",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php",
            "line": 175,
            "function": "then",
            "class": "Illuminate\Pipeline\Pipeline",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php",
            "line": 144,
            "function": "sendRequestThroughRouter",
            "class": "Illuminate\Foundation\Http\Kernel",
            "type": "->"
        },
        {
            "file": "C:\Users\m\jbd\public\index.php",
            "line": 52,
            "function": "handle",
            "class": "Illuminate\Foundation\Http\Kernel",
            "type": "->"
        },
        {
            "file": "C:\Users\m\AppData\Roaming\Composer\vendor\cretueusebiu\valet-windows\server.php",
            "line": 241,
            "function": "require"
        }
    ]
}

Please or to participate in this conversation.