Why is Delete/put request important?

2006 views php

I am new to laravel. I made an website to do simple CRUD operation. In my web.php I used route::post() to delete a data. It worked perfectly.

Later I learned that, there is a delete method in laravel. Why should I use delete method when post works perfectly?

answered question

1 Answer


Post method is laravel is a simple post request that form does while submitting, but Delete method in laravel specify the type of method being used while posting data, so when you are using Delete method then your form must have Delete input field which specifies the type of action your form is doing on submit with post request. But with simple Post method you don't need any post field it's just a post request with data. for more reference check this https://laravel.com/docs/5.7/routing#route-group-prefixes

posted this

Have an answer?


Please login first before posting an answer.