laravel 5 create or update code example
Example 1: update or create laravel
$user = User::updateOrCreate(['name' => request()->name], [
'foo' => request()->foo
]);
Example 2: laravel update first
Model::where(['x' => 1, 'y' => 2])->first()->update([...]);