laravel eloquent insert or update with array code example
Example: update or create laravel
$user = User::updateOrCreate(['name' => request()->name], [
'foo' => request()->foo
]);
$user = User::updateOrCreate(['name' => request()->name], [
'foo' => request()->foo
]);