grapper betsapi

This commit is contained in:
salam committed 2025-12-22 08:15:59 +01:00
1 parent 406fd26864
commit a3c9f16550
127 files changed
+158128 -650

No files matched your search

@@ -10,9 +10,7 @@ use Carbon\Carbon;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Tables\Table;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
class EventResource extends Resource
{
@@ -28,27 +26,6 @@ class EventResource extends Resource
protected static ?string $pluralModelLabel = '';
// protected static ?string $recordTitleAttribute = 'tx_id';
// public static function getGlobalSearchResultTitle(Model $record): string|Htmlable
// {
// return $record->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);
@@ -34,17 +34,18 @@ class EventsTable
->size(IconSize::ExtraLarge)
->icon(fn ($record) => $record->sport->icon)
->tooltip(fn ($record) => $record->id),
TextColumn::make('tx_id')
TextColumn::make('txodds_id')
->state(fn ($record) => $record->id)
->description(fn ($record) => $record->betsapi_id)
->copyable()
->label('Id')
->badge()
->searchable()
->copyable(),
->alignCenter(),
TextColumn::make('starttime')
->label('Start')
->alignCenter()
->dateTime('d.m')
->dateTime('H:i')
->weight(FontWeight::Bold)
->description(fn ($state): string => Carbon::createFromDate($state)->format('H:i')),
->description(fn ($state): string => Carbon::createFromDate($state)->format('d. M')),
TextColumn::make('country.name')
->searchable()
->color('gray')
@@ -56,7 +57,9 @@ class EventsTable
->alignRight(),
TextColumn::make('away.name')
->searchable(),
MultilineColumn::make('id')->label(fn () => view('filament.tables.columns.multiline.label')),
MultilineColumn::make('id')
->searchable()
->label(fn () => view('filament.tables.columns.multiline.label')),
])
->poll('10s')
->defaultSort('starttime', 'ASC')
@@ -105,7 +108,7 @@ class EventsTable
fn (Builder $query, $sport_id) => $query->where('country_id', $sport_id)
)->when(
$data['competition_group_id'],
fn (Builder $query, $competition_group_id) => $query->where('competition_group_id', $competition_group_id)
fn (Builder $query, $competition_group_id) => $query->whereIn('competition_group_id', $competition_group_id)
);
})
->columns(6)->columnSpan(6),
@@ -121,7 +124,7 @@ class EventsTable
->label('TxOdds')
->disabled(fn () => ! auth()->user()->super_admin)
->icon('heroicon-o-arrow-top-right-on-square')
->url(fn ($record): string => route('txodds_odds', ['sportid' => $record->sport_id, 'txoddsid' => $record->tx_id]))
->url(fn ($record): string => route('txodds_odds', ['sportid' => $record->sport_id, 'txoddsid' => $record->id]))
->openUrlInNewTab(),
])->iconButton()
->icon('heroicon-m-ellipsis-vertical')
@@ -22,7 +22,10 @@ class SupervisorsTable
->options([
'Fixtures' => 'Fixtures',
'Odds' => 'Odds',
'IdMapper' => 'IdMapper',
'Willhill' => 'Willhill',
'Bwin' => 'Bwin',
'Bet365' => 'Bet365',
'Betfair' => 'Betfair',
]),
TextColumn::make('provider.name')->badge(),
TextColumn::make('sport.name')->label('Sport'),