Support the ongoing development of →
Requests Blade Forms
Last updated 2 years ago.

The only methods that are valid within a form tag are "GET" and "POST". Since "DELETE" isn't valid, it's probably falling back on "GET".

However, Laravel has a way around this. Just add a hidden input inside of the form with a name of _method:

<input type="hidden" name="_method" value="delete" />

Let me know how this works!

P.S. It also looks like you're not returning anything in your destroy method. You should be returning a view, or a redirect.

Last updated 8 years ago.

the url display http://localhost:8000/products/productsname?_method=delete and still displays '' route

when i try other method error:

MethodNotAllowedHttpException in RouteCollection.php line 219: in RouteCollection.php line 219 at RouteCollection->methodNotAllowed(array('GET', 'HEAD', 'PUT', 'PATCH', 'DELETE')) in RouteCollection.php line 206 at RouteCollection->getRouteForMethods(object(Request), array('GET', 'HEAD', 'PUT', 'PATCH', 'DELETE')) in RouteCollection.php line 158

Last updated 8 years ago.

I'm so fool I should using POST method and it works, now it calls to the right route name. thanks for pointing that out. I'm to focused to the error message


Yeah, I should have mentioned that you have to set it to post, my bad.

I'm glad you got it figured out!


Sign in to participate in this thread!


Your banner here too?

eiyu eiyu Joined 26 Jan 2016


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.