where('sport_id', $options['sport_id'])->where('customer_id', $options['customer_id'])->get(); $_hash = []; foreach ($res as $value) { $event_id = $value['event_id']; $_hash[$event_id] = ['hash' => $value['hash'], 'timestamp' => strtotime($value['updated_at'])]; } return $_hash; } public static function load_event($options) { $res = EventCustomer::select('calculation_hash')->where('event_id', $options['event_id'])->where('customer_id', $options['customer_id'])->first(); if ($res) { return $res->calculation_hash; } return false; } }