I need to change value of my request parameter like this:
$request->name = \"My Value!\";
I use
Try to:
$requestData = $request->all();
$requestData['img'] = $img;
Another way to do it:
$request->merge(['img' => $img]);
Thanks to @JoelHinz for this.
If you want to add or overwrite nested data:
$data['some']['thing'] = 'value';
$request->merge($data);
If you do not inject Request $request
object, you can use the global request()
helper or \Request::
facade instead of $request