home->name.' - '.$record->away->name; // } // public static function getGlobalSearchResultDetails(Model $record): array // { // return [ // 'League' => $record->competition_group->name, // 'Country' => $record->country->name, // ]; // } // public static function getGloballySearchableAttributes(): array // { // return ['tx_id', 'betradar_id', 'competition_group.name', 'country.name', 'away.name', 'home.name']; // } // public static function getGlobalSearchResultUrl(Symbol|Model $record): string // { // return EventResource::getUrl('edit', ['record' => $record]); // Links to the edit page // } public static function form(Schema $schema): Schema { return EventForm::configure($schema); } public static function table(Table $table): Table { return EventsTable::configure($table); } public static function getPages(): array { return [ 'index' => ListEvents::route('/'), ]; } public static function getNavigationBadge(): ?string { return parent::getEloquentQuery() ->where('sport_id', auth()->user()->sport_id) ->where('starttime', '>', Carbon::now()) ->count(); } public static function getEloquentQuery(): Builder { return parent::getEloquentQuery() ->where('starttime', '>', Carbon::now()) ->where('sport_id', auth()->user()->sport_id); } }