I need to change value of my request parameter like this:
$request->name = "My Value!";
我使用此代码,但不起作用:
$request->offsetSet('img', $img);
I need to change value of my request parameter like this:
$request->name = "My Value!";
我使用此代码,但不起作用:
$request->offsetSet('img', $img);
使用merge()
:
$request->merge([
'user_id' => $modified_user_id_here,
]);
Simple! No need to transfer the entire $request->all()
to another variable.