From 6b4fc0b8a10559c1440ee69554c0524d1df35d10 Mon Sep 17 00:00:00 2001 From: salam Date: Wed, 28 Jan 2026 19:43:03 +0100 Subject: [PATCH] adding more filter --- .../Resources/Events/Tables/EventsTable.php | 59 ++++++++++++++++++- app/Livewire/PartnerProgramm.php | 13 ++++ .../seeders/RolesAndPermissionsSeeder.php | 4 +- .../views/livewire/partner-programm.blade.php | 3 + setup.sh | 26 ++++---- 5 files changed, 90 insertions(+), 15 deletions(-) create mode 100644 app/Livewire/PartnerProgramm.php create mode 100644 resources/views/livewire/partner-programm.blade.php diff --git a/app/Filament/Resources/Events/Tables/EventsTable.php b/app/Filament/Resources/Events/Tables/EventsTable.php index 79f22d62..fe9256bc 100644 --- a/app/Filament/Resources/Events/Tables/EventsTable.php +++ b/app/Filament/Resources/Events/Tables/EventsTable.php @@ -25,6 +25,7 @@ use Filament\Actions\DeleteAction; use Filament\Actions\DeleteBulkAction; use Filament\Forms\Components\Hidden; use Filament\Forms\Components\Select; +use Filament\Forms\Components\TextInput; use Filament\Schemas\Components\Utilities\Get; use Filament\Support\Enums\FontWeight; use Filament\Support\Enums\VerticalAlignment; @@ -173,7 +174,7 @@ class EventsTable ->extremePaginationLinks() ->filters([ Filter::make('events') - ->columns(5)->columnSpan(5) + ->columns(8)->columnSpan(8) ->schema([ Hidden::make('filter_alarm_green'), Hidden::make('filter_alarm_yellow'), @@ -202,6 +203,7 @@ class EventsTable Select::make(name: 'country_id') ->hidden(fn () => self::$user->sport_id == 5) ->placeholder('Country') + ->prefixIcon('phosphor-flag') ->hiddenLabel() ->label('') ->multiple() @@ -220,6 +222,7 @@ class EventsTable Select::make('competition_group_id') ->hidden(fn () => self::$user->sport_id == 5) ->placeholder('League') + ->prefixIcon('phosphor-trophy') ->hiddenLabel() ->label('') ->multiple() @@ -242,6 +245,7 @@ class EventsTable Select::make('group_id') ->visible(fn () => self::$user->sport_id == 5) ->placeholder('Tournament') + ->prefixIcon('phosphor-trophy') ->hiddenLabel() ->label('') ->multiple() @@ -261,6 +265,7 @@ class EventsTable return $arr; }) ->live(), + DateRangePicker::make('starttime_period') ->columnSpan(2) ->displayFormat('d M Y') @@ -268,6 +273,50 @@ class EventsTable ->hiddenLabel() ->label('') ->live(), + + TextInput::make('favorit_threshold') + ->prefixIcon('phosphor-less-than') + ->suffix('Favorit') + ->numeric() + ->minValue(1.01) + ->maxValue(3.00) + ->step(0.01) + ->hiddenLabel(), + + Select::make('special_filter_base') + ->placeholder('Filters Base') + ->prefixIcon('phosphor-funnel') + ->hiddenLabel() + ->native(false) + ->allowHtml() + ->options([ + 'sp1' => 'Nig ≠ Ken', + 'sp3' => 'Favorit ≥ ', + 'sp4' => 'Favorit ≤ ', + 'sp5' => 'X ≤ ', + 'sp6' => 'Margin ≥ ', + 'sp7' => 'Margin ≤ ', + ]), + + Select::make('special_filter') + ->placeholder('Special Filters') + ->prefixIcon('phosphor-funnel') + ->hiddenLabel() + ->disabled() + ->native(false) + ->allowHtml() + ->options([ + 'Events' => [ + 'sp1' => 'Nigeria > Colombia', + 'sp2' => 'Nigeria < Colombia', + ], + 'Odds' => [ + 'sp3' => 'Favorit < Sportingbet', + 'sp4' => 'Favorit > Sportingbet', + 'sp5' => 'Favorit < Bet365', + 'sp6' => 'Favorit > Bet365', + ], + ]), ]) ->query(function (Builder $query, array $data): Builder { return $query->when( @@ -349,6 +398,10 @@ class EventsTable }); }); } + // )->when( + // $data('favorit_threshold'), + // function (Builder $query, $favorit_threshold) {} + // whereRaw("LEAST(price_one, price_two, price_three) BETWEEN ? AND ?", [$min, $max]) ); })->indicateUsing(function (array $data): array { $indicators = []; @@ -408,6 +461,10 @@ class EventsTable } } + if ($data['favorit_threshold'] ?? null) { + $indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('info'); + } + if ($data['stars_status'] ?? null) { $indicators[] = Indicator::make('Favorits')->removeField('stars_status')->color('info'); } diff --git a/app/Livewire/PartnerProgramm.php b/app/Livewire/PartnerProgramm.php new file mode 100644 index 00000000..6ec8ca9e --- /dev/null +++ b/app/Livewire/PartnerProgramm.php @@ -0,0 +1,13 @@ + 'super_admin', 'guard_name' => 'web'], ['name' => 'konto_switch', 'guard_name' => 'web'], ['name' => 'mapper_source_betsapi', 'guard_name' => 'web'], + ['name' => 'partner_porgramm', 'guard_name' => 'web'], ], ['name'] ); @@ -32,6 +33,7 @@ class RolesAndPermissionsSeeder extends Seeder $user->assignRole('super_admin'); $user->assignRole('konto_switch'); $user->assignRole('mapper_source_betsapi'); + $user->assignRole('partner_porgramm'); $user = User::factory()->create([ 'name' => 'Ubaldo Perrucci', @@ -45,6 +47,6 @@ class RolesAndPermissionsSeeder extends Seeder ]); $user->assignRole('super_admin'); $user->assignRole('konto_switch'); - $user->assignRole('mapper_source_betsapi'); + $user->assignRole('partner_porgramm'); } } diff --git a/resources/views/livewire/partner-programm.blade.php b/resources/views/livewire/partner-programm.blade.php new file mode 100644 index 00000000..ad9a90f6 --- /dev/null +++ b/resources/views/livewire/partner-programm.blade.php @@ -0,0 +1,3 @@ +
+ {{-- To attain knowledge, add things every day; To attain wisdom, subtract things every day. --}} +
diff --git a/setup.sh b/setup.sh index 982ccdaa..be815469 100755 --- a/setup.sh +++ b/setup.sh @@ -49,22 +49,22 @@ case "$1" in php artisan nuh --d --t --f 20 php artisan nuh --d --t --f 21 php artisan nuh --d --t --f 22 - php artisan nuh --d --t 3 + php artisan nuh --d --f --t 3 php artisan nuh --d --f 4 php artisan nuh --d --f 5 php artisan nuh --d --f 6 - php artisan nuh --d --f 8 - php artisan nuh --d --f 9 - php artisan nuh --d --f 10 - php artisan nuh --d --f 11 - php artisan nuh --d --f 12 - php artisan nuh --d --f 13 - php artisan nuh --d --f 14 - php artisan nuh --d --f 15 - php artisan nuh --d --f 16 - php artisan nuh --d --f 17 - php artisan nuh --d --f 18 - php artisan nuh --d --f 19 + php artisan nuh --d --f 8 + php artisan nuh --d --f 9 + php artisan nuh --d --f 10 + php artisan nuh --d --f 11 + php artisan nuh --d --f 12 + php artisan nuh --d --f 13 + php artisan nuh --d --f 14 + php artisan nuh --d --f 15 + php artisan nuh --d --f 16 + php artisan nuh --d --f 17 + php artisan nuh --d --f 18 + php artisan nuh --d --f 19 ;; "10") echo ""