Event Mapper to dedicated page

This commit is contained in:
salam committed 2026-03-25 14:59:53 +01:00
1 parent 32cc345125
commit b362fdc15f
2 files changed
+272 -184

No files matched your search

+77 -2
View File
@@ -2,13 +2,19 @@
namespace App\Filament\Pages;
use App\Models\User;
use BackedEnum;
use Filament\Actions\Action;
use Filament\Actions\ActionGroup;
use Filament\Notifications\Notification;
use Filament\Pages\Page;
class EventMapper extends Page
{
protected $listeners = [
'refresh' => '$refresh',
];
protected string $view = 'filament.pages.event-mapper';
protected static string|BackedEnum|null $navigationIcon = 'phosphor-arrows-in-line-horizontal';
@@ -18,11 +24,80 @@ class EventMapper extends Page
return [
ActionGroup::make([
Action::make('bet365')
->visible(fn (): bool => auth()->user()->hasRole('mapper_source_betsapi') && auth()->user()->provider_id != 2)
->action(fn() => User::),
->extraAttributes(['x-on:click' => 'toggle'])
->visible(fn (): bool => auth()->user()->provider_id != 2)
->action(function ($livewire) {
User::where('id', auth()->user()->id)->update(['provider_id' => 2]);
Notification::make()
->title('Event Mapper changed to Bet365')
->success()
->send();
$livewire->dispatch('refresh');
}),
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]))
->action(function ($livewire) {
User::where('id', auth()->user()->id)->update(['provider_id' => 3]);
$livewire->dispatch('refresh');
Notification::make()
->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]))
->action(function ($livewire) {
User::where('id', auth()->user()->id)->update(['provider_id' => 4]);
$livewire->dispatch('refresh');
Notification::make()
->title('Event Mapper changed to MAGLOO KENIA')
->success()
->send();
}),
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]))
->action(function ($livewire) {
User::where('id', auth()->user()->id)->update(['provider_id' => 5]);
$livewire->dispatch('refresh');
Notification::make()
->title('Event Mapper changed to LOGIFUTURE NIGERIA')
->success()
->send();
}),
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]))
->action(function ($livewire) {
User::where('id', auth()->user()->id)->update(['provider_id' => 6]);
$livewire->dispatch('refresh');
Notification::make()
->title('Event Mapper changed to LOGIFUTURE COLOMBIA')
->success()
->send();
}),
])
->label('Swop Bookmaker')
->icon('phosphor-dots-three-vertical')
->visible(fn (): bool => auth()->user()->hasRole('mapper_source_betsapi'))
->color('primary')
->button(),
];