Skip to content
Advertisement

The PUT method is not supported for this route. Supported methods: POST using laravel ajax

i have in an annonces table a multiple images, i want to update multiple images,I just want to send the data to controller but it gives me error : The PUT method is not supported for this route. Supported methods: POST.I don’t know where the error is.

web.php

JavaScript

AnnoncesController.php

JavaScript

details.blade.php

JavaScript

Advertisement

Answer

<input type="hidden" name="_method" value="PUT"> is responsible for method spoofing – means it instructs Laravel to use a PUT method for handling the request.

Since your route is defined as POST

JavaScript

Try removing <input type="hidden" name="_method" value="PUT"> from the form to get rid of the error – if it works then it means that your form is not getting submitted via ajax

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement