Zobjoys Jeirmov
Zobjoys Jeirmov

Reputation: 221

When use POST and PUT Method In Laravel?

I don't know exact difference between POST and PUT method.Some of the people said on internet that when you update record at time you have to use PUT method instead of POST, i don't know is it true??

form Internet if your website URL in POST method 1. www.example.com/user/{id}/update :- PUT use 2. www.example.com/user/update :- POST use this is right or not ??

Upvotes: 1

Views: 5829

Answers (1)

Louie Albarico
Louie Albarico

Reputation: 280

If you're inserting a new data you'll most likely use POST method

Route::post('new/data', 'NewDataController@store');

If you want to edit or add a new data that is not existing, you must use PUT method

Route::put('/data', 'NewDataController@update');

Upvotes: 6

Related Questions