where('bookmaker_id', $base['bookmaker_id'])->first(); if (! $res) { OddsDc::create($odds); } else { $res->dc1x = $odds['dc1x']; $res->dc12 = $odds['dc12']; $res->dcx2 = $odds['dcx2']; $res->flags = 1; if ($res->isDirty()) { $res->oddchange_at = now(); } $res->checked_at = $odds['checked_at']; $res->margin = $odds['margin']; $res->save(); } } }