laravel modify eloquent on insert 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
]);