ListEvents::route('/'), ]; } public static function getNavigationBadge(): ?string { return parent::getEloquentQuery() ->where('starttime', '>', Carbon::now()) ->count(); } public static function getEloquentQuery(): Builder { $query = parent::getEloquentQuery() ->with('competition_group') ->with('country') ->with('home') ->with('away') ->with('event_user_star') ->where('starttime', '>=', now()); if (auth()->user()->stars) { $query->whereHas('event_user_star'); } if (auth()->user()->all_only_none) { switch (auth()->user()->bookmaker_id) { case 10: $field = 'magnig_id'; break; case 16: $field = 'magken_id'; break; case 35: $field = 'lognig_id'; break; case 36: $field = 'logcol_id'; break; } switch (auth()->user()->all_only_none) { case 1: $query->where($field, 1); break; case 2: $query->where($field, 0); break; } } if (in_array('odds_2ways', EventsTable::$bettype_settings)) { $query->with('odds_2ways.bookmaker'); } if (in_array('odds_2ways_s1', EventsTable::$bettype_settings)) { $query->with('odds_2ways_s1.bookmaker'); } if (in_array('odds_3ways', EventsTable::$bettype_settings)) { $query->with('odds_3ways.bookmaker'); } if (in_array('odds_3ways_ht', EventsTable::$bettype_settings)) { $query->with('odds_3ways_ht.bookmaker'); } if (in_array('odds_dc', EventsTable::$bettype_settings)) { $query->with('odds_dc.bookmaker'); } if (in_array('odds_dnb', EventsTable::$bettype_settings)) { $query->with('odds_dnb.bookmaker'); } if (in_array('odds_ggng', EventsTable::$bettype_settings)) { $query->with('odds_ggng.bookmaker'); } if (in_array('odds_points', EventsTable::$bettype_settings)) { $query->with('odds_points.bookmaker'); } if (in_array('odds_points_ht', EventsTable::$bettype_settings)) { $query->with('odds_points_ht.bookmaker'); } if (in_array('odds_points_q1', EventsTable::$bettype_settings)) { $query->with('odds_points_q1.bookmaker'); } if (in_array('odds_totals', EventsTable::$bettype_settings)) { $query->with('odds_totals.bookmaker'); } if (in_array('odds_totals_ht', EventsTable::$bettype_settings)) { $query->with('odds_totals_ht.bookmaker'); } if (in_array('odds_totals_q1', EventsTable::$bettype_settings)) { $query->with('odds_totals_q1.bookmaker'); } if (in_array('odds_tq', EventsTable::$bettype_settings)) { $query->with('odds_tq.bookmaker'); } return $query; } }