//if there is id => 1 for user role , update this and if there is not
//id => 1 create it and insert some data for it
$data = $request->all();
UserRule::updateOrCreate(
['id' => 1],
$data
);
User::where('id', $user_id)
->update([
'name' => $name
]);
$user = User::updateOrCreate(['name' => request()->name], [
'foo' => request()->foo
]);
$user = User::updateOrCreate(
['email' => request('email')],
['name' => request('name')]
);
// Do other things with the User
// If there's a flight from Oakland to San Diego, set the price to $99.
// If no matching model exists, create one.
$flight = AppModelsFlight::updateOrCreate(
['departure' => 'Oakland', 'destination' => 'San Diego'],
['price' => 99, 'discounted' => 1]
);
DB::table('vendor_managements')->where('vendor_code', $vendor_code)->update(array('state'=> $state_namne));