“laravel add request”
laravel add values to request
1
laravel add request
2
laravel get all request parameters
1
how to see with page reuested in laravel
0
The normal procedure is-
function storeDate(Request $request)
{
return $request->all();
}
This method will receive all the submitted field data from the web form.
Now, if you need to add extra data into request
array, you can add this way.
function storeDate(Request $request)
{
$authorName = 'Put your value here';
$myNewData = $request->request->add(['author' => $authorName]);
return $request->all();
}
Now you are able to access $authorName
in the request
array.
If you have more than one value you want to add, you can pass another value into the array like this way-
$myNewData = $request->request->add([
'author' => $authorName
'author2' => $authorName2
]);
Hope it will be helpful for you. Thank you.
0 comments:
Post a Comment
Thanks