From 7e000dce88b01c93580ae999dc5be603078d5b2f Mon Sep 17 00:00:00 2001 From: salam Date: Sun, 12 Jul 2026 09:01:31 +0200 Subject: [PATCH] HasPageShield to mapper --- app/Filament/Pages/EventMapper.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/Filament/Pages/EventMapper.php b/app/Filament/Pages/EventMapper.php index fafc036e..b3f5805b 100644 --- a/app/Filament/Pages/EventMapper.php +++ b/app/Filament/Pages/EventMapper.php @@ -4,6 +4,7 @@ namespace App\Filament\Pages; use App\Models\User; use BackedEnum; +use BezhanSalleh\FilamentShield\Traits\HasPageShield; use Filament\Actions\Action; use Filament\Actions\ActionGroup; use Filament\Notifications\Notification; @@ -11,6 +12,8 @@ use Filament\Pages\Page; class EventMapper extends Page { + use HasPageShield; + protected $listeners = [ 'refresh' => '$refresh', ]; @@ -33,7 +36,7 @@ class EventMapper extends Page ActionGroup::make([ Action::make('bet365') ->extraAttributes(['x-on:click' => 'toggle']) - ->visible(fn (): bool => auth()->user()->provider_id != 2) + ->visible(fn(): bool => auth()->user()->provider_id != 2) ->action(function ($livewire) { User::where('id', auth()->user()->id)->update(['provider_id' => 2]); @@ -46,8 +49,8 @@ class EventMapper extends Page Action::make('magloo_nigeria') ->label('MAGLOO NIGERIA') ->extraAttributes(['x-on:click' => 'toggle']) - ->visible(fn (): bool => in_array(auth()->user()->provider_id, [2, 4])) - ->hidden(fn (): bool => ! in_array(auth()->user()->bookmaker_id, [10, 16])) + ->visible(fn(): bool => in_array(auth()->user()->provider_id, [2, 4])) + ->hidden(fn(): bool => ! in_array(auth()->user()->bookmaker_id, [10, 16])) ->action(function ($livewire) { User::where('id', auth()->user()->id)->update(['provider_id' => 3]); $livewire->dispatch('refresh'); @@ -56,13 +59,12 @@ class EventMapper extends Page ->title('Event Mapper changed to MAGLOO NIGERIA') ->success() ->send(); - }), Action::make('magloo_kenia') ->label('MAGLOO KENIA') ->extraAttributes(['x-on:click' => 'toggle']) - ->visible(fn (): bool => in_array(auth()->user()->provider_id, [2, 3])) - ->hidden(fn (): bool => ! in_array(auth()->user()->bookmaker_id, [10, 16])) + ->visible(fn(): bool => in_array(auth()->user()->provider_id, [2, 3])) + ->hidden(fn(): bool => ! in_array(auth()->user()->bookmaker_id, [10, 16])) ->action(function ($livewire) { User::where('id', auth()->user()->id)->update(['provider_id' => 4]); $livewire->dispatch('refresh'); @@ -75,8 +77,8 @@ class EventMapper extends Page Action::make('logifuture_nigeria') ->label('LOGIFUTURE NIGERA') ->extraAttributes(['x-on:click' => 'toggle']) - ->visible(fn (): bool => auth()->user()->provider_id == 6) - ->hidden(fn (): bool => ! in_array(auth()->user()->bookmaker_id, [35, 36])) + ->visible(fn(): bool => auth()->user()->provider_id == 6) + ->hidden(fn(): bool => ! in_array(auth()->user()->bookmaker_id, [35, 36])) ->action(function ($livewire) { User::where('id', auth()->user()->id)->update(['provider_id' => 5]); @@ -90,8 +92,8 @@ class EventMapper extends Page Action::make('logifuture_colombia') ->label('LOGIFUTURE COLOMBIA') ->extraAttributes(['x-on:click' => 'toggle']) - ->visible(fn (): bool => auth()->user()->provider_id == 5) - ->hidden(fn (): bool => ! in_array(auth()->user()->bookmaker_id, [35, 36])) + ->visible(fn(): bool => auth()->user()->provider_id == 5) + ->hidden(fn(): bool => ! in_array(auth()->user()->bookmaker_id, [35, 36])) ->action(function ($livewire) { User::where('id', auth()->user()->id)->update(['provider_id' => 6]); @@ -105,7 +107,7 @@ class EventMapper extends Page ]) ->label('Swop Bookmaker') ->icon('phosphor-dots-three-vertical') - ->visible(fn (): bool => auth()->user()->hasRole('mapper_source_betsapi')) + ->visible(fn(): bool => auth()->user()->hasRole('mapper_source_betsapi')) ->color('primary') ->button(), ];