create and update checking if a recorrd exists to update table laravel 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
]);