diff --git a/app/Console/Commands/Grapper/Logifuture.php b/app/Console/Commands/Grapper/Logifuture.php index cea052fb..34d159ea 100644 --- a/app/Console/Commands/Grapper/Logifuture.php +++ b/app/Console/Commands/Grapper/Logifuture.php @@ -77,7 +77,7 @@ class Logifuture 'event_id' => $event['id'], 'sport_id' => $sport_id, 'bookmaker_id' => Nuh::$options['bookmaker_id'], - ], ['in_feed' => 1, 'bmoid' => $event['id'], 'startime' => $event['starttime']]); + ], ['in_feed' => 1, 'bmoid' => $event['id'], 'starttime' => $event['starttime']]); }, 5); switch ($sport_id) { diff --git a/app/Filament/Resources/Events/Tables/EventsTable.php b/app/Filament/Resources/Events/Tables/EventsTable.php index 76b5cf1e..b7c31f38 100644 --- a/app/Filament/Resources/Events/Tables/EventsTable.php +++ b/app/Filament/Resources/Events/Tables/EventsTable.php @@ -7,6 +7,7 @@ use App\Filament\Resources\Events\Tables\Tools\LoadBettypeSettings; use App\Filament\Resources\Events\Tables\Tools\LoadCompareDifferences; use App\Filament\Resources\Events\Tables\Tools\LoadMultiline; use App\Filament\Tables\Columns\ColumnOdds; +use App\Filament\Tables\Columns\ColumnStarttime; use App\Filament\Tables\Columns\EventColumn; use App\Filament\Tables\Columns\MatchIds; use App\Filament\Tables\Columns\TooltipOdds; @@ -31,7 +32,6 @@ use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Filament\Schemas\Components\FusedGroup; use Filament\Schemas\Components\Utilities\Get; -use Filament\Support\Enums\FontWeight; use Filament\Support\Enums\VerticalAlignment; use Filament\Support\Enums\Width; use Filament\Tables\Columns\IconColumn; @@ -43,7 +43,6 @@ use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; -use Illuminate\Support\HtmlString; class EventsTable { @@ -80,24 +79,24 @@ class EventsTable MatchIds::make('ids')->grow(false)->visibleFrom('xl') ->visible(fn () => auth()->user()->hasRole('super_admin')), - TextColumn::make('event_bookmaker.starttime') - ->timezone('CET') - ->label('Start') - ->alignCenter() - ->dateTime('H:i') - ->weight(FontWeight::Bold) - ->color(function ($record) { - $bkm = $record->event_bookmaker?->starttime ?? null; - if ($bkm) { - return $bkm != $record->starttime ? 'danger' : 'info'; - } + ColumnStarttime::make('starttime')->label('Start'), - return 'gray'; - }) - ->state(function ($record) { - return $record->event_bookmaker->starttime ?? $record->starttime; - }) - ->description(fn ($record): string => Carbon::createFromDate($record->event_bookmaker->starttime ?? $record->starttime)->format('d. M')), + // TextColumn::make('event_bookmaker.starttime') + // ->timezone('CET') + // ->label('Start') + // ->alignCenter() + // ->dateTime('H:i') + // ->color(function ($record) { + // $bkm = $record->event_bookmaker?->starttime ?? null; + // if ($bkm) { + // return $bkm != $record->starttime ? 'danger' : 'info'; + // } + + // return 'gray'; + // }) + // ->state(function ($record) { + // return $record->event_bookmaker->starttime ?? $record->starttime; + // }), TextColumn::make('country.name') ->wrap() @@ -212,7 +211,6 @@ class EventsTable ->prefixIcon('phosphor-flag') ->hiddenLabel() ->label('') - ->multiple() ->searchable() ->preload() ->options(function () { @@ -235,7 +233,7 @@ class EventsTable ->searchable() ->options(function (Get $get) { if ($get('country_id')) { - $res = Event::where('has_markets', 1)->where('sport_id', auth()->user()->sport_id)->with('country')->with('competition_group')->where('country_id', $get('country_id'))->whereDate('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get(); + $res = Event::where('has_markets', 1)->where('sport_id', auth()->user()->sport_id)->with('country')->with('competition_group')->where('country_id', $get('country_id'))->groupBy('competition_group_id')->get(); } else { $res = Event::where('has_markets', 1)->where('sport_id', auth()->user()->sport_id)->with('country')->with('competition_group')->whereDate('starttime', '>', Carbon::now())->groupBy('competition_group_id')->get(); } @@ -466,12 +464,8 @@ class EventsTable })->indicateUsing(function (array $data): array { $indicators = []; if ($data['country_id'] ?? null) { - $countries = Country::whereIn('id', $data['country_id'])->pluck('name')->toArray(); - if (count($countries) > 1) { - $indicators[] = Indicator::make('Countries: '.implode(', ', $countries))->removeField('country_id')->color('warning'); - } else { - $indicators[] = Indicator::make('Country: '.$countries[0])->removeField('country_id')->color('warning'); - } + $countries = Country::where('id', $data['country_id'])->pluck('name')->toArray(); + $indicators[] = Indicator::make('Countries: '.implode(', ', $countries))->removeField('country_id')->color('warning'); } if ($data['group_id'] ?? null) { @@ -699,10 +693,10 @@ class EventsTable ])->iconButton() ->icon('phosphor-dots-three-vertical'), - // ])->toolbarActions([ - // BulkActionGroup::make([ - // DeleteBulkAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')), - // ]), + ])->toolbarActions([ + BulkActionGroup::make([ + DeleteBulkAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')), + ]), ]); } } diff --git a/app/Filament/Tables/Columns/ColumnStarttime.php b/app/Filament/Tables/Columns/ColumnStarttime.php new file mode 100644 index 00000000..b1f84587 --- /dev/null +++ b/app/Filament/Tables/Columns/ColumnStarttime.php @@ -0,0 +1,47 @@ +tx = Carbon::createFromTimestamp(strtotime($record->starttime)); + if ($record->event_bookmaker?->starttime) { + $this->cl = Carbon::createFromTimestamp(strtotime($record->event_bookmaker?->starttime)); + $this->starttime = Carbon::createFromTimestamp(strtotime($record->event_bookmaker?->starttime)); + + if ($this->tx == $this->cl) { + $this->color = 'text-green-600'; + } else { + $this->color = 'text-orange-600'; + } + } else { + $this->color = 'text-blue-600'; + $this->starttime = Carbon::createFromTimestamp(strtotime($record->starttime)); + } + } + + public function getColor() + { + return $this->color; + } + + public function getStarttime() + { + return $this->starttime; + } +} diff --git a/composer.lock b/composer.lock index c80782d8..e152d787 100644 --- a/composer.lock +++ b/composer.lock @@ -3017,16 +3017,16 @@ }, { "name": "laravel/framework", - "version": "v12.52.0", + "version": "v12.53.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "d5511fa74f4608dbb99864198b1954042aa8d5a7" + "reference": "f57f035c0d34503d9ff30be76159bb35a003cd1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/d5511fa74f4608dbb99864198b1954042aa8d5a7", - "reference": "d5511fa74f4608dbb99864198b1954042aa8d5a7", + "url": "https://api.github.com/repos/laravel/framework/zipball/f57f035c0d34503d9ff30be76159bb35a003cd1f", + "reference": "f57f035c0d34503d9ff30be76159bb35a003cd1f", "shasum": "" }, "require": { @@ -3235,7 +3235,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-02-17T17:07:04+00:00" + "time": "2026-02-24T14:35:15+00:00" }, { "name": "laravel/prompts", @@ -3298,16 +3298,16 @@ }, { "name": "laravel/serializable-closure", - "version": "v2.0.9", + "version": "v2.0.10", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "8f631589ab07b7b52fead814965f5a800459cb3e" + "reference": "870fc81d2f879903dfc5b60bf8a0f94a1609e669" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/8f631589ab07b7b52fead814965f5a800459cb3e", - "reference": "8f631589ab07b7b52fead814965f5a800459cb3e", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/870fc81d2f879903dfc5b60bf8a0f94a1609e669", + "reference": "870fc81d2f879903dfc5b60bf8a0f94a1609e669", "shasum": "" }, "require": { @@ -3355,7 +3355,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2026-02-03T06:55:34+00:00" + "time": "2026-02-20T19:59:49+00:00" }, { "name": "laravel/tinker", @@ -13299,12 +13299,12 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^8.3" }, - "platform-dev": [], - "plugin-api-version": "2.6.0" + "platform-dev": {}, + "plugin-api-version": "2.9.0" } diff --git a/config/app.php b/config/app.php index 28be821a..0f69d36d 100644 --- a/config/app.php +++ b/config/app.php @@ -65,7 +65,7 @@ return [ | */ - 'timezone' => env('APP_TIMEZONE', 'UTC'), + 'timezone' => env('APP_TIMEZONE', 'Europe/Vienna'), /* |-------------------------------------------------------------------------- diff --git a/resources/views/filament/tables/columns/column-starttime.blade.php b/resources/views/filament/tables/columns/column-starttime.blade.php new file mode 100644 index 00000000..fa8ddcb8 --- /dev/null +++ b/resources/views/filament/tables/columns/column-starttime.blade.php @@ -0,0 +1,37 @@ +@php + $setTime($record); + $starttime = $getStarttime(); + $color = $getColor(); +@endphp +