735 0 0 0
Last Updated : 2025-04-28 22:12:23
In some cases you might want to inject extra values to the request object that already is holding a form data for example, to do so there are numerous ways, here are some:
$request->request->add(['variable' => 'value']); //add request
function store(Request $request)
{
// some additional logic or checking
User::create(array_merge($request->all(), ['index' => 'value']));
}
//OR
User::create($request->all() + ['index' => 'value']);