Laravel PUT request parameter

When the route is:


Then in controller I get the parameter like this:

   $r->get('param')   // with Request $r

But while the route is of a PUT request type:


That code doesn't work. It doesn't get the value of parameter.


Try setting x-www-form-urlencoded for body in the postman.

Set method to POST and add _method field with PUT value


$api->put('photos', 'App\Api\V1\Controllers\PhotoController@updatePhoto');

Controller code:

public function updatePhoto(Request $request)
    $paramValue = $request->get('param_name');

Working fine for me.

<input type="hidden" name="_method" value="PUT">

Just added an extra field in form. works perfect!

If submitting an API request and you don't want your developers to send a POST request with _method=PUT request variable, see solution here:

Need Your Help

Xcode 8 Issue : Frame for "Navigation Bar" will be different at run time

ios xcode xcode8

When we Embed your view controller in Navigation Controller. Then facing issue with navigation bar.

Show only two digit after decimal

java android number-formatting

How to get the double value that is only two digit after decimal point.