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

Jordan13's avatar

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

Hi everyone! I'll explain my problem.

Locally the app works correctly, once uploaded to the server, all requests that are not GET that I have within my app, are treated as if they were GET! (get requests work fine)

sorry if I don't post a screen, I'm in a hurry, this is one of the broken routes

Route::post('/cart/{product:id}', [CartController::class, 'store'])->name('cart.store');

I've already seen the various solutions online and on this forum, I've removed trailing slashes, I've checked everything...

I can't use the terminal to clear cache or similar, but I still ran the commands with Artisan::call('...') and they ran fine!

could it be a problem with how the server accepts and handles requests?

Thanks in advance

0 likes
9 replies
LaryAI's avatar
Level 58

This issue could be caused by a misconfiguration in the server. One possible solution is to check if the server is properly configured to handle POST requests. Another solution is to try changing the route method to GET and see if it works. If it does, then the issue might be with the server configuration.

If the issue persists, try clearing the route cache by running the following command in the terminal:

php artisan route:clear

If none of the above solutions work, try checking the server logs for any errors or warnings related to the issue.

1 like
shariff's avatar

You to need to clear route cache

php artisan optimize
php artisan route:clear
Jordan13's avatar

@shariff Thanks for the reply, unfortunately I can't run scripts from terminal

Jordan13's avatar

Yes, I changed the request to get and it works as it should.. I assume it's a server problem

Snapey's avatar

@hibabnr probably some funky redirect in .htaccess to try and hide public in the url

tendegrees's avatar

I had the same issue with valet, I was using valet secure which redirects to https, but i was sending json to http version. when I start sending to https it worked.

1 like

Please or to participate in this conversation.