If you need to check if the record exists, and then update it, or create a new record otherwise, you can do it in one sentence - use Eloquent method updateOrCreate()
:
1// Instead of this 2$flight = Flight::where('departure', 'Oakland') 3 ->where('destination', 'San Diego') 4 ->first(); 5if ($flight) { 6 $flight->update(['price' => 99, 'discounted' => 1]); 7} else { 8 $flight = Flight::create([ 9 'departure' => 'Oakland',10 'destination' => 'San Diego',11 'price' => 99,12 'discounted' => 113 ]);14}15// Do it in ONE sentence16$flight = Flight::updateOrCreate(17 ['departure' => 'Oakland', 'destination' => 'San Diego'],18 ['price' => 99, 'discounted' => 1]19);