Laravel use PUT or PATCH in Postman

28 Feb 2019 . Tips and Tricks . 1.4K views

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', '[email protected]')->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 :).