get request parameters laravel code example
Example 1: laravel get query parameters
$name = $request->query('name', 'Helen');
Example 2: public function store(Request $request)
input('name');
//
}
}
Example 3: check method in laravel
if ($request->isMethod('post')) {
return ['user' => $user];
}
Example 4: laravel get data from request
dd($request->all());
//print an array of the input name and the input value
Example 5: check method in laravel
if ($request->isMethod('post')) {
// statement
}