Skip to content

4xx Client errors

405 Method Not Allowed

The URL exists, but not for this HTTP method, for example a GET to a POST-only route.

Common causes

  • A form posting to a route defined with Route::get (or the other way round).
  • A PUT or DELETE form without @method.
  • A cached route list from an older deploy.

How to fix a 405 error

  1. 1

    Match the route method to the form or the request.

  2. 2

    Add @method('PUT') or @method('DELETE') inside the form.

  3. 3

    Run php artisan route:clear (and route:cache again if you use it).

In Laravel

Laravel says "The GET method is not supported for route … Supported methods: POST." The message names the allowed methods.

Check the status of a URL

The first line of the response shows the status code; -L follows redirects and shows each step.

curl -I https://example.com/page
curl -IL https://example.com/old-page

Frequently asked questions

What does HTTP 405 mean?

The URL exists, but not for this HTTP method, for example a GET to a POST-only route.

How do I fix a 405 error?

Match the route method to the form or the request. Add @method('PUT') or @method('DELETE') inside the form. Run php artisan route:clear (and route:cache again if you use it).

How does Laravel handle 405?

Laravel says "The GET method is not supported for route … Supported methods: POST." The message names the allowed methods.

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.