80554/how-to-change-value-of-a-request-parameter-in-laravel
I need to change value of my request parameter like this:
$request->name = "My Value!";
I use this code but does not work:
$request->offsetSet('img', $img);
How to change value of a request parameter in laravel?
Hello @kartik,
Use merge():
$request->merge([ 'user_id' => $modified_user_id_here, ]);
No need to transfer the entire $request->all() to another variable.
Hope it helps!!
Thank You!!
Hello, To create both of the created_at and updated_at columns: $t->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP')); $t->timestamp('updated_at')->default(DB::raw('CURRENT_TIMESTAMP on update ...READ MORE
Hello, Route::getRoutes() returns a RouteCollection. On each element, you can ...READ MORE
Hey, In order to identify the type of ...READ MORE
Hey, Facades provide a "static" interface to classes ...READ MORE
Hey @kartik, First you have to go to ...READ MORE
Named route is used to give specific ...READ MORE
Hello, This is simple you just need to ...READ MORE
Hey @kartik, Named routing is another amazing feature of ...READ MORE
You need do little modification in your ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.