skip to Main Content

The GET method is not supported for this route. Supported methods: POST.

php artisan route:cache
php artisan route:clear
how much time we fire this command i need proper solution of this error

i need proper solution of this error

2

Answers


  1. When you use GET type of route in your routes/web.php file, in form which is using the method with type "POST", it gives The GET method is not supported for this route as there is conflict between the submission type at the frontend and the route type.

    Try converting your route in routes/web.php:

    Route::get('/some-url', 'NameOfController@NameOfFunction');
    

    to this:

    Route::post('/some-url', 'NameOfController@NameOfFunction');
    
    Login or Signup to reply.
  2. The error statement is quiet explanatory! But your question is not. Without your code snippet, it is seen that you are trying to access the endpoint that is only supporting POST so as solution do – either :

    1. Try POST request for the endpoint OR
    2. If its your own api, and if required you can make the end point support GET like this Route::get('/get-something', 'yourController@yourFunctionForHandlingThisRoute');
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search