wip fix
This commit is contained in:
1 parent
9bcd4432c6
commit
6f92f9e1d5
1209 files changed
+220940
No files matched your search
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
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;
|
||||
use Filament\Pages\Page;
|
||||
|
||||
class EventMapper extends Page
|
||||
{
|
||||
use HasPageShield;
|
||||
|
||||
protected $listeners = [
|
||||
'refresh' => '$refresh',
|
||||
];
|
||||
|
||||
protected string $view = 'filament.pages.event-mapper';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = 'phosphor-arrows-in-line-horizontal';
|
||||
|
||||
protected static ?string $navigationLabel = 'Mapper';
|
||||
|
||||
protected ?string $heading = '';
|
||||
|
||||
protected static ?int $navigationSort = 4; // Smaller number = higher up
|
||||
|
||||
// protected static ?int $navigationSort = 100;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
ActionGroup::make([
|
||||
Action::make('bet365')
|
||||
->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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user