Answers for "add new to laravel request"

PHP
1

laravel add values to request

request()->request->add(['index'=>'value']);
Posted by: Guest on March-16-2021
2

laravel create new request

$myRequest = new \Illuminate\Http\Request();
$myRequest->setMethod('POST'); //default METHOD
$myRequest->request->add(['foo' => 'bar']);
dd($request->foo);
Posted by: Guest on May-24-2021

Browse Popular Code Answers by Language