object request to array in laravel code example
Example: check method in laravel
if ($request->isMethod('post')) {
return ['user' => $user];
}
if ($request->isMethod('post')) {
return ['user' => $user];
}