Dmytro Soltusyuk
Dmytro Soltusyuk

Reputation: 440

Laravel doesn't support DELETE & PUT requests?

Building my API it turned out, that if I am using DELETE or PUT requests Laravel throws 405 Error (Method Not Allowed). How to make it work?

Laravel error:

Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException The PUT method is not supported for this route. Supported methods: GET, HEAD.

Upvotes: 0

Views: 870

Answers (1)

CBrach
CBrach

Reputation: 107

Laravel does support DELETE and PUT. You defined your route wrong, it only allows GET-Requests.

Route::put('/put', 'Controller@function');
Route::delete('/delete', 'Controller@function');

See docs here

Upvotes: 2

Related Questions