Laravel use PUT or PATCH in Postman

Laravel use PUT or PATCH in Postman

Posted on:February 28, 2019 at 10:00 AM

If you are developing any API endpoint where you need to build an endpoint for updating record, the first choose in your mind will come to use either put or patch. However, using put or patch as a http verb and test it in postman is not that easy. Today, I will show you how to use Laravel PUT or PATCH in Postman.

Just imagine that, you have a route like this-

Route::put('/posts', 'PostsController@update')->name('post.update');

Now, once you want to try in postman by using put or patch, it already return an empty array of user’s request.

 Laravel use PUT or PATCH in Postman

Now, to avoid this, you need to pass an extra body parameter that is _method = put.

It will be like the following image.

 Laravel use PUT or PATCH in Postman

Hope it will help you. TQ :).