pn51291
170
5
Laravel

laravel can't destroy item

Posted 1 month ago by pn51291

Hi guys,

I'm trying to delete an item in database. I created a form with @csrf and @method('DELETE'), but when I try to delete, it didn't do anything or display any errors. It just add the secret_token, title and method to the url.

http://dmhsclone.test/items/1?_token=2dbzgaW4RMxurm67JQubHBJztxuHvtjCoNyn8XIu&item_title=Youth&_token=2dbzgaW4RMxurm67JQubHBJztxuHvtjCoNyn8XIu&_method=DELETE

I also put a dd() in the destroy(), but it didn't reach the destroy(). Not sure, what have I done wrong here?.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.