removed shield use superadmin
This commit is contained in:
1 parent
7fd7f706bc
commit
419148cd18
60 files changed
+611
-2363
No files matched your search
@@ -1,64 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Comparatore;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\Supervisor;
|
||||
use App\Utilities\Notice;
|
||||
use App\Utilities\Supervisorctl;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class Comparatore extends Command
|
||||
{
|
||||
public static $events = [];
|
||||
|
||||
public static $sport_id = 0;
|
||||
|
||||
public static $options = [];
|
||||
|
||||
public static $force = 0;
|
||||
|
||||
public static $debug = 0;
|
||||
|
||||
protected $signature = 'com {process=help} {eventid=0} {--d} {--f} {--a} {--p} {--w}';
|
||||
|
||||
protected $description = 'Comparatore';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
self::$options = $this->options();
|
||||
self::$options['supervisor_id'] = $this->argument('process');
|
||||
self::$options['event_id'] = $this->argument('eventid');
|
||||
|
||||
if ($this->argument('process') == 'help') {
|
||||
$txt = PHP_EOL.'a com process [id] eventid [id]'.PHP_EOL;
|
||||
$txt .= '--d debug'.PHP_EOL;
|
||||
$txt .= '--f force update market'.PHP_EOL;
|
||||
$txt .= '--a reload all'.PHP_EOL;
|
||||
$txt .= '--w reload one week'.PHP_EOL;
|
||||
$txt .= '--p print feed'.PHP_EOL.PHP_EOL;
|
||||
$txt .= 'eventid'.PHP_EOL.PHP_EOL;
|
||||
$txt .= 'use "com l" to show options'.PHP_EOL;
|
||||
Notice::note($txt, 'b', 1);
|
||||
} elseif ($this->argument('process') == 'l') {
|
||||
$txt = 'list of comparatore processes';
|
||||
$txt .= Supervisor::list('com');
|
||||
Notice::note($txt, 'b', 1);
|
||||
}
|
||||
|
||||
Supervisorctl::start(self::$options);
|
||||
|
||||
$res = Event::where('time', '>', Carbon::now()->toDateTimeString())->get();
|
||||
|
||||
foreach ($res as $event) {
|
||||
$bookmaker = EventBookmaker::where('event_id', $event->id)->get();
|
||||
if ($bookmaker->count() != null) {
|
||||
dd($bookmaker);
|
||||
}
|
||||
}
|
||||
|
||||
Supervisorctl::end(self::$options);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,9 @@ use App\Console\Commands\Curl;
|
||||
use App\Console\Commands\Grapper\Helper;
|
||||
use App\Console\Commands\NuhBash;
|
||||
use App\Models\Event;
|
||||
use App\Models\Odds3way;
|
||||
use App\Models\OddsQualify;
|
||||
use App\Models\OddsTotal;
|
||||
use App\Utilities\Notice;
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -135,8 +138,8 @@ class Odds
|
||||
break;
|
||||
|
||||
case 'group':
|
||||
$e['group'] = $v['@attributes']['cname'];
|
||||
$e['gid'] = $v['@attributes']['id'];
|
||||
$e['liga'] = $v['@attributes']['cname'];
|
||||
$e['liid'] = $v['@attributes']['id'];
|
||||
$e['cgid'] = $v['@attributes']['cgid'];
|
||||
$e['spid'] = $v['@attributes']['spid'];
|
||||
$e['mgid'] = $v['@attributes']['mgid'];
|
||||
@@ -173,66 +176,139 @@ class Odds
|
||||
switch ($type) {
|
||||
case '@attributes':
|
||||
$bettypeid = (int) $od['ot'];
|
||||
dd('add to event bookmaker missing');
|
||||
// 'book_startime' => $od['@attributes']['starting_time'],
|
||||
$bmoid = $od['bmoid'];
|
||||
break;
|
||||
case 'odds':
|
||||
switch ($bettypeid) {
|
||||
|
||||
case '0':
|
||||
// three way
|
||||
$e['odds_3ways'][] = [
|
||||
'event_id' => $e['id'],
|
||||
'bookmaker_id' => $bkmid,
|
||||
'matchpart_id' => 1,
|
||||
'sport_id' => 1,
|
||||
'bmoid' => $bmoid,
|
||||
'start' => $od['@attributes']['starting_time'],
|
||||
'h3w' => (float) $od['o1'],
|
||||
'd3w' => (float) $od['o2'],
|
||||
'a3w' => (float) $od['o3'],
|
||||
'margin' => (float) Helper::margin([$od['o1'], $od['o2'], $od['o3']], 1),
|
||||
'book_startime' => $od['@attributes']['starting_time'],
|
||||
'source_updated_at' => $od['@attributes']['time'],
|
||||
'nuh_last_check' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
Odds3way::updateOrCreate(
|
||||
[
|
||||
'event_id' => $e['id'],
|
||||
'bookmaker_id' => $bkmid,
|
||||
'sport_id' => NuhBash::$options['sport_id'],
|
||||
'bmoid' => $bmoid,
|
||||
],
|
||||
[
|
||||
'start' => $od['@attributes']['starting_time'],
|
||||
'h3w' => (float) $od['o1'],
|
||||
'd3w' => (float) $od['o2'],
|
||||
'a3w' => (float) $od['o3'],
|
||||
'margin' => (float) Helper::margin([$od['o1'], $od['o2'], $od['o3']], 1),
|
||||
'flag' => 1,
|
||||
'check' => 0,
|
||||
'source_updated_at' => $od['@attributes']['time'],
|
||||
'last_check_at' => Carbon::now()->toDateTimeString(),
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case '1':
|
||||
Odds2way::updateOrCreate(
|
||||
[
|
||||
'event_id' => $e['id'],
|
||||
'bookmaker_id' => $bkmid,
|
||||
'sport_id' => NuhBash::$options['sport_id'],
|
||||
'bmoid' => $bmoid,
|
||||
],
|
||||
[
|
||||
'start' => $od['@attributes']['starting_time'],
|
||||
'h2w' => (float) $od['o1'],
|
||||
'a2w' => (float) $od['o3'],
|
||||
'margin' => (float) Helper::margin([$od['o1'], $od['o3']], 1),
|
||||
'flag' => 1,
|
||||
'check' => 0,
|
||||
'source_updated_at' => $od['@attributes']['time'],
|
||||
'last_check_at' => Carbon::now()->toDateTimeString(),
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case '4':
|
||||
// totals
|
||||
$e['odds_totals'][] = [
|
||||
'event_id' => $e['id'],
|
||||
'bookmaker_id' => $bkmid,
|
||||
'matchpart_id' => 1,
|
||||
'sport_id' => 1,
|
||||
'bmoid' => $bmoid,
|
||||
'over' => (float) $od['o1'],
|
||||
'under' => (float) $od['o2'],
|
||||
'spread' => (float) $od['o3'],
|
||||
'margin' => (float) Helper::margin([$od['o1'], $od['o2']], 1),
|
||||
'flag' => 1,
|
||||
'check' => 0,
|
||||
'book_startime' => $od['@attributes']['starting_time'],
|
||||
'source_updated_at' => $od['@attributes']['time'],
|
||||
'nuh_last_check' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
OddsTotal::updateOrCreate(
|
||||
[
|
||||
'event_id' => $e['id'],
|
||||
'bookmaker_id' => $bkmid,
|
||||
'sport_id' => NuhBash::$options['sport_id'],
|
||||
'bmoid' => $bmoid,
|
||||
'spread' => (float) $od['o3'],
|
||||
],
|
||||
[
|
||||
'start' => $od['@attributes']['starting_time'],
|
||||
'over' => (float) $od['o1'],
|
||||
'under' => (float) $od['o2'],
|
||||
'margin' => (float) Helper::margin([$od['o1'], $od['o2'], $od['o3']], 1),
|
||||
'flag' => 1,
|
||||
'check' => 0,
|
||||
'source_updated_at' => $od['@attributes']['time'],
|
||||
'last_check_at' => Carbon::now()->toDateTimeString(),
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case '5242880':
|
||||
// double chance
|
||||
$e['odds_dc'][] = [
|
||||
'event_id' => $e['id'],
|
||||
'bookmaker_id' => $bkmid,
|
||||
'matchpart_id' => 1,
|
||||
'sport_id' => 1,
|
||||
'bmoid' => $bmoid,
|
||||
'dc1x' => (float) $od['o1'],
|
||||
'dc12' => (float) $od['o2'],
|
||||
'dc2x' => (float) $od['o3'],
|
||||
'margin' => (float) Helper::margin([$od['o1'], $od['o2'], $od['o3']], 1),
|
||||
'book_startime' => $od['@attributes']['starting_time'],
|
||||
'source_updated_at' => $od['@attributes']['time'],
|
||||
'nuh_last_check' => Carbon::now()->toDateTimeString(),
|
||||
];
|
||||
OddsDc::updateOrCreate(
|
||||
[
|
||||
'event_id' => $e['id'],
|
||||
'bookmaker_id' => $bkmid,
|
||||
'sport_id' => NuhBash::$options['sport_id'],
|
||||
'bmoid' => $bmoid,
|
||||
],
|
||||
[
|
||||
'start' => $od['@attributes']['starting_time'],
|
||||
'dc1x' => (float) $od['o1'],
|
||||
'dc12' => (float) $od['o2'],
|
||||
'dc2x' => (float) $od['o3'],
|
||||
'margin' => (float) Helper::margin([$od['o1'], $od['o2'], $od['o3']], 1),
|
||||
'flag' => 1,
|
||||
'check' => 0,
|
||||
'source_updated_at' => $od['@attributes']['time'],
|
||||
'last_check_at' => Carbon::now()->toDateTimeString(),
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case '11534337':
|
||||
OddsGgng::updateOrCreate(
|
||||
[
|
||||
'event_id' => $e['id'],
|
||||
'bookmaker_id' => $bkmid,
|
||||
'sport_id' => NuhBash::$options['sport_id'],
|
||||
'bmoid' => $bmoid,
|
||||
],
|
||||
[
|
||||
'start' => $od['@attributes']['starting_time'],
|
||||
'gg' => (float) $od['o1'],
|
||||
'ng' => (float) $od['o3'],
|
||||
'margin' => (float) Helper::margin([$od['o1'], $od['o3']], 1),
|
||||
'flag' => 1,
|
||||
'check' => 0,
|
||||
'source_updated_at' => $od['@attributes']['time'],
|
||||
'last_check_at' => Carbon::now()->toDateTimeString(),
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case '11534337':
|
||||
OddsQualify::updateOrCreate(
|
||||
[
|
||||
'event_id' => $e['id'],
|
||||
'bookmaker_id' => $bkmid,
|
||||
'sport_id' => NuhBash::$options['sport_id'],
|
||||
'bmoid' => $bmoid,
|
||||
],
|
||||
[
|
||||
'start' => $od['@attributes']['starting_time'],
|
||||
'htq' => (float) $od['o1'],
|
||||
'atq' => (float) $od['o2'],
|
||||
'margin' => (float) Helper::margin([$od['o1'], $od['o3']], 1),
|
||||
'flag' => 1,
|
||||
'check' => 0,
|
||||
'source_updated_at' => $od['@attributes']['time'],
|
||||
'last_check_at' => Carbon::now()->toDateTimeString(),
|
||||
]
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -247,124 +323,6 @@ class Odds
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
dd($e);
|
||||
|
||||
// if (NuhBash::$options['d']) {
|
||||
// Notice::note((int) $row['id'].' : '.$row->hteam.' - '.$row->ateam, 'b', 1);
|
||||
// }
|
||||
// dd($data);
|
||||
|
||||
// if (NuhBash::$options['p']) {
|
||||
// Notice::note($url);
|
||||
// foreach ($xml->match as $match) {
|
||||
// print_r($match);
|
||||
// }
|
||||
// exit;
|
||||
// }
|
||||
|
||||
// foreach ($xml->match as $m) {
|
||||
|
||||
// if (NuhBash::$options['d']) {
|
||||
// Notice::note((int) $m['id'].' : '.$m->hteam.' - '.$m->ateam);
|
||||
// }
|
||||
|
||||
// $evid = Event::where('txid', (int) $m['id'])->pluck('id')->first();
|
||||
|
||||
// if ($evid) {
|
||||
// $fixed_array = [];
|
||||
// $fixed_array['event_id'] = $evid;
|
||||
|
||||
// Event::where('id', $evid)->update(['cnt_bkm_tx' => count($m->bookmaker)]);
|
||||
|
||||
// foreach ($m->bookmaker as $bookmaker) {
|
||||
|
||||
// $fixed_array['bkid'] = (int) $bookmaker['bid'];
|
||||
|
||||
// $value_array = [];
|
||||
|
||||
// foreach ($bookmaker->offer as $offer) {
|
||||
// switch ($offer['ot']) {
|
||||
// case '0':
|
||||
|
||||
// $value_array['f3w'] = (int) $offer['flags'] ?? 0;
|
||||
// $value_array['boid'] = (string) $offer['bmoid'] ?? 0;
|
||||
// $value_array['time'] = Carbon::parse($offer->odds['starting_time'])->toDateTimeString();
|
||||
|
||||
// $tmp = [];
|
||||
// $tmp['h3w'] = (float) $offer->odds->o1 ?? 1;
|
||||
// $tmp['d3w'] = (float) $offer->odds->o2 ?? 1;
|
||||
// $tmp['a3w'] = (float) $offer->odds->o3 ?? 1;
|
||||
// $tmp['m3w'] = Helper::margin($tmp);
|
||||
// $value_array += $tmp;
|
||||
// break;
|
||||
|
||||
// case '1':
|
||||
|
||||
// $value_array['f2w'] = (int) $offer['flags'] ?? 0;
|
||||
// $value_array['boid'] = (string) $offer['bmoid'] ?? 0;
|
||||
// $value_array['time'] = Carbon::parse($offer->odds['starting_time'])->toDateTimeString();
|
||||
|
||||
// $tmp = [];
|
||||
// $tmp['h2w'] = (float) $offer->odds->o1 ?? 1;
|
||||
// $tmp['a2w'] = (float) $offer->odds->o3 ?? 1;
|
||||
// $tmp['m2w'] = Helper::margin($tmp);
|
||||
// $value_array += $tmp;
|
||||
// break;
|
||||
|
||||
// case '4':
|
||||
// $hc = (float) $offer->odds->o3;
|
||||
// if (NuhBash::$options['sport_id'] == 1 && $hc == 2.5) {
|
||||
// $tmp = [];
|
||||
// $tmp['ov'] = (float) $offer->odds->o1 ?? 1;
|
||||
// $tmp['un'] = (float) $offer->odds->o2 ?? 1;
|
||||
// $tmp['mto'] = Helper::margin($tmp);
|
||||
// $tmp['fto'] = (int) $offer->odd['flags'] ?? 0;
|
||||
// $tmp['hc'] = 2.5;
|
||||
// $value_array += $tmp;
|
||||
// }
|
||||
// break;
|
||||
|
||||
// case '5242880':
|
||||
// // Double Chance (dc1x,dc12,dcx2)
|
||||
// $value_array['fdc'] = (int) $offer['flags'] ?? 0;
|
||||
// $tmp = [];
|
||||
// $tmp['dc1x'] = (float) $offer->odds->o1 ?? 1;
|
||||
// $tmp['dc12'] = (float) $offer->odds->o2 ?? 1;
|
||||
// $tmp['dcx2'] = (float) $offer->odds->o3 ?? 1;
|
||||
// $tmp['mdc'] = Helper::margin($tmp);
|
||||
// $value_array += $tmp;
|
||||
// break;
|
||||
|
||||
// case '11534337':
|
||||
// // goal/nogoal (gg,ng)
|
||||
// $value_array['fgg'] = (int) $offer['flags'] ?? 0;
|
||||
// $tmp = [];
|
||||
// $tmp['gg'] = (float) $offer->odds->o1 ?? 1;
|
||||
// $tmp['ng'] = (float) $offer->odds->o3 ?? 1;
|
||||
// $tmp['mgg'] = Helper::margin($tmp);
|
||||
// $value_array += $tmp;
|
||||
// break;
|
||||
|
||||
// case '7340033':
|
||||
// // to qualify (htq,atq)
|
||||
// $value_array['ftq'] = (int) $offer['flags'] ?? 0;
|
||||
// $tmp = [];
|
||||
// $tmp['htq'] = (float) $offer->odds->o1 ?? 1;
|
||||
// $tmp['atq'] = (float) $offer->odds->o3 ?? 1;
|
||||
// $tmp['mtq'] = Helper::margin($tmp);
|
||||
// $value_array += $tmp;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// EventBookmaker::updateOrCreate($fixed_array, $value_array);
|
||||
// if (NuhBash::$options['d']) {
|
||||
// Notice::note($fixed_array + $value_array, 'b');
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,11 @@ class TxSwitch
|
||||
*/
|
||||
public static function switch()
|
||||
{
|
||||
switch (NuhBash::$options['id']) {
|
||||
case 1:
|
||||
switch (NuhBash::$options['name']) {
|
||||
case 'Fixtures':
|
||||
Fixtures::grap();
|
||||
break;
|
||||
case 2:
|
||||
case 'Odds':
|
||||
Odds::grap();
|
||||
break;
|
||||
case 3:
|
||||
@@ -27,7 +27,7 @@ class TxSwitch
|
||||
case 5:
|
||||
break;
|
||||
default:
|
||||
Note::notice('wrong process id for txodds', 'r', 1);
|
||||
Note::notice('prosses name does not exist', 'r', 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ class NuhBash extends Command
|
||||
public function handle()
|
||||
{
|
||||
self::$options = $this->options();
|
||||
|
||||
self::$options['supervisor_id'] = $this->argument('process');
|
||||
self::$options['event_id'] = $this->argument('eventid');
|
||||
|
||||
$queries = self::$options['m'] ?? 0;
|
||||
|
||||
if ($this->argument('process') == 'help') {
|
||||
@@ -59,25 +59,21 @@ class NuhBash extends Command
|
||||
|
||||
Supervisorctl::start(self::$options);
|
||||
|
||||
switch (self::$options['type']) {
|
||||
case 'Grapper':
|
||||
switch (self::$options['provider_id']) {
|
||||
case 1:
|
||||
TxSwitch::switch();
|
||||
case 2:
|
||||
// betsapi
|
||||
break;
|
||||
case 3:
|
||||
// direct
|
||||
break;
|
||||
default:
|
||||
Note::notice('Provider not defined', 'r', 1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
if (! self::$options['is_active']) {
|
||||
Notice::note('Process disabled', 'r', 1);
|
||||
}
|
||||
|
||||
case 'Comparatore':
|
||||
// code...
|
||||
switch (self::$options['provider_id']) {
|
||||
case 1:
|
||||
// direct
|
||||
break;
|
||||
case 2:
|
||||
TxSwitch::switch();
|
||||
case 3:
|
||||
// betsapi
|
||||
break;
|
||||
default:
|
||||
Note::notice('Provider not defined', 'r', 1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\Administrator;
|
||||
|
||||
use BackedEnum;
|
||||
use Filament\Clusters\Cluster;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
|
||||
class AdministratorCluster extends Cluster
|
||||
{
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedSquares2x2;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Bookmakers;
|
||||
|
||||
use App\Filament\Clusters\Administrator\AdministratorCluster;
|
||||
use App\Filament\Resources\Bookmakers\Pages\ListBookmakers;
|
||||
use App\Filament\Resources\Bookmakers\Schemas\BookmakerForm;
|
||||
use App\Filament\Resources\Bookmakers\Tables\BookmakersTable;
|
||||
@@ -19,8 +20,15 @@ class BookmakerResource extends Resource
|
||||
|
||||
protected static string|\BackedEnum|null $navigationIcon = 'lucide-notebook-pen';
|
||||
|
||||
protected static ?string $cluster = AdministratorCluster::class;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Administration';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return BookmakerForm::configure($schema);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Clients;
|
||||
|
||||
use App\Filament\Clusters\Administrator\AdministratorCluster;
|
||||
use App\Filament\Resources\Clients\Pages\ListClients;
|
||||
use App\Filament\Resources\Clients\Schemas\ClientForm;
|
||||
use App\Filament\Resources\Clients\Tables\ClientsTable;
|
||||
@@ -18,8 +19,15 @@ class ClientResource extends Resource
|
||||
|
||||
protected static string|\BackedEnum|null $navigationIcon = 'lucide-square-user';
|
||||
|
||||
protected static ?string $cluster = AdministratorCluster::class;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'User';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return ClientForm::configure($schema);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Countries;
|
||||
|
||||
use App\Filament\Clusters\Administrator\AdministratorCluster;
|
||||
use App\Filament\Resources\Countries\Pages\ManageCountries;
|
||||
use App\Models\Country;
|
||||
use Filament\Actions\EditAction;
|
||||
@@ -27,8 +28,15 @@ class CountryResource extends Resource
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
protected static ?string $cluster = AdministratorCluster::class;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Administration';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
|
||||
@@ -11,22 +11,19 @@ use Filament\Support\Enums\IconSize;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
class EventsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->poll('10s')
|
||||
->columns([
|
||||
IconColumn::make('sport.icon')
|
||||
->label('')
|
||||
->size(IconSize::ExtraLarge)
|
||||
->icon(fn ($record) => $record->sport->icon)
|
||||
->extraAttributes(fn ($record): array => [
|
||||
'x-tooltip.html' => new HtmlString,
|
||||
'x-tooltip.raw' => new HtmlString('Betradar: '.$record->betaid_id.'<br>TxOdds: '.$record->txodds_id),
|
||||
]),
|
||||
->tooltip(fn ($record) => $record->txodds_id),
|
||||
TextColumn::make('starttime')
|
||||
->label('Start')
|
||||
->alignCenter()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Providers;
|
||||
|
||||
use App\Filament\Clusters\Administrator\AdministratorCluster;
|
||||
use App\Filament\Resources\Providers\Pages\ListProviders;
|
||||
use App\Filament\Resources\Providers\Schemas\ProviderForm;
|
||||
use App\Filament\Resources\Providers\Tables\ProvidersTable;
|
||||
@@ -20,7 +21,14 @@ class ProviderResource extends Resource
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Administration';
|
||||
protected static ?string $cluster = AdministratorCluster::class;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Grapper';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Sports;
|
||||
|
||||
use App\Filament\Clusters\Administrator\AdministratorCluster;
|
||||
use App\Filament\Resources\Sports\Pages\ManageSports;
|
||||
use App\Models\Sport;
|
||||
use Filament\Resources\Resource;
|
||||
@@ -23,8 +24,15 @@ class SportResource extends Resource
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
protected static ?string $cluster = AdministratorCluster::class;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Administration';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
|
||||
namespace App\Filament\Resources\Supervisors\Schemas;
|
||||
|
||||
use App\Models\Bookmaker;
|
||||
use App\Models\Sport;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Schemas\Components\Fieldset;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class SupervisorForm
|
||||
@@ -17,24 +14,10 @@ class SupervisorForm
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Toggle::make('is_cron')->columns(2),
|
||||
TextInput::make('name')
|
||||
->required()
|
||||
->columnSpan(2),
|
||||
Select::make('type')
|
||||
->options([
|
||||
'Grapper' => 'Grapper',
|
||||
'Comparatore' => 'Comparatore',
|
||||
])
|
||||
->default('Grapper')
|
||||
->selectablePlaceholder(false),
|
||||
Select::make('filetype')
|
||||
->label('File Type')
|
||||
->options([
|
||||
'json' => 'json',
|
||||
'xml' => 'xml',
|
||||
])
|
||||
->default('json')
|
||||
->selectablePlaceholder(false),
|
||||
Select::make('provider_id')
|
||||
->relationship('provider', 'name')
|
||||
->required()
|
||||
@@ -42,18 +25,9 @@ class SupervisorForm
|
||||
Select::make('sport_id')
|
||||
->options(Sport::query()->where('is_active', 1)->pluck('name', 'id'))
|
||||
->nullable(),
|
||||
Select::make('bookmaker_id')
|
||||
->options(Bookmaker::query()->where('is_active', 1)->pluck('name', 'id'))
|
||||
->selectablePlaceholder(true),
|
||||
Fieldset::make('Supervisor or Cron Toggle')
|
||||
->schema([
|
||||
Toggle::make('is_cron')->live(),
|
||||
TextInput::make('sleep')
|
||||
->label('Sleep between loops')
|
||||
->hidden(fn (Get $get): bool => $get('is_cron'))
|
||||
->numeric()
|
||||
->default(30),
|
||||
])->columnSpan(2),
|
||||
|
||||
TextInput::make('sleep'),
|
||||
TextInput::make('maxsconds')->label('Seconds till throwing an error'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Supervisors;
|
||||
|
||||
use App\Filament\Clusters\Administrator\AdministratorCluster;
|
||||
use App\Filament\Resources\Supervisors\Pages\ListSupervisors;
|
||||
use App\Filament\Resources\Supervisors\Schemas\SupervisorForm;
|
||||
use App\Filament\Resources\Supervisors\Tables\SupervisorsTable;
|
||||
@@ -16,9 +17,16 @@ class SupervisorResource extends Resource
|
||||
|
||||
protected static string|\BackedEnum|null $navigationIcon = 'lucide-sliders-vertical';
|
||||
|
||||
protected static ?string $cluster = AdministratorCluster::class;
|
||||
|
||||
protected static ?int $navigationSort = 20;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Administration';
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Grapper';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
|
||||
namespace App\Filament\Resources\Supervisors\Tables;
|
||||
|
||||
use App\Models\Bookmaker;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Columns\ToggleColumn;
|
||||
use Filament\Tables\Table;
|
||||
@@ -19,35 +17,13 @@ class SupervisorsTable
|
||||
->columns([
|
||||
TextColumn::make('id')->badge(),
|
||||
TextColumn::make('name')->searchable(),
|
||||
TextColumn::make('type')->badge(),
|
||||
TextColumn::make('provider.name')
|
||||
->badge()->color(fn (string $state): string => match ($state) {
|
||||
'txodds' => 'danger',
|
||||
'bestapi' => 'success',
|
||||
'direct' => 'primary',
|
||||
default => 'warning',
|
||||
}),
|
||||
TextColumn::make('provider.name')->badge(),
|
||||
TextColumn::make('sport.name')->label('Sport'),
|
||||
IconColumn::make('bookmaker_id')
|
||||
->label('Book')
|
||||
->icon(function ($state): string {
|
||||
if ($state) {
|
||||
return 'bkm-'.Bookmaker::where('id', $state)->pluck('icon')->first();
|
||||
}
|
||||
}),
|
||||
TextColumn::make('sleep')->numeric(),
|
||||
TextColumn::make('runtime'),
|
||||
TextColumn::make('runtime')->label('Run Time'),
|
||||
TextColumn::make('maxsconds')->label('Max Time'),
|
||||
TextColumn::make('lastcall'),
|
||||
IconColumn::make('is_cron')->boolean()->label('Cron')->falseColor('gray'),
|
||||
TextColumn::make('filetype')->badge()->alignCenter(),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
TextColumn::make('updated_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
ToggleColumn::make('is_cron')->label('Cron'),
|
||||
ToggleColumn::make('is_active')->label('On/Off'),
|
||||
])
|
||||
->filters([
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\Users;
|
||||
|
||||
use App\Filament\Clusters\Administrator\AdministratorCluster;
|
||||
use App\Filament\Resources\Users\Pages\ListUsers;
|
||||
use App\Filament\Resources\Users\Schemas\UserForm;
|
||||
use App\Filament\Resources\Users\Tables\UsersTable;
|
||||
@@ -20,8 +21,15 @@ class UserResource extends Resource
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
protected static ?string $cluster = AdministratorCluster::class;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'User';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return UserForm::configure($schema);
|
||||
|
||||
@@ -12,7 +12,6 @@ class Odds2way extends Model
|
||||
'id',
|
||||
'event_id',
|
||||
'sport_id',
|
||||
'matchpart_id',
|
||||
'bookmaker_id',
|
||||
'provider_id',
|
||||
'home',
|
||||
@@ -24,10 +23,6 @@ class Odds2way extends Model
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'matchpart_id' => EnumMatchpart::class,
|
||||
];
|
||||
|
||||
public function sport()
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
@@ -38,11 +33,6 @@ class Odds2way extends Model
|
||||
return $this->belongsTo(Bookmaker::class);
|
||||
}
|
||||
|
||||
public function matchpart()
|
||||
{
|
||||
return $this->belongsTo(Matchpart::class);
|
||||
}
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
|
||||
@@ -12,7 +12,6 @@ class Odds3way extends Model
|
||||
'id',
|
||||
'event_id',
|
||||
'sport_id',
|
||||
'matchpart_id',
|
||||
'bookmaker_id',
|
||||
'provider_id',
|
||||
'home',
|
||||
@@ -25,10 +24,6 @@ class Odds3way extends Model
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'matchpart_id' => EnumMatchpart::class,
|
||||
];
|
||||
|
||||
public function sport()
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
@@ -39,11 +34,6 @@ class Odds3way extends Model
|
||||
return $this->belongsTo(Bookmaker::class);
|
||||
}
|
||||
|
||||
public function matchpart()
|
||||
{
|
||||
return $this->belongsTo(Matchpart::class);
|
||||
}
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OddsDc extends Model
|
||||
{
|
||||
protected $table = 'odds_dc';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'event_id',
|
||||
'sport_id',
|
||||
'bookmaker_id',
|
||||
'provider_id',
|
||||
'dnb1',
|
||||
'dnb2',
|
||||
'margin',
|
||||
'flag',
|
||||
'check',
|
||||
'add_time',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
}
|
||||
|
||||
public function bookmaker()
|
||||
{
|
||||
return $this->belongsTo(Bookmaker::class);
|
||||
}
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
}
|
||||
|
||||
public function provider()
|
||||
{
|
||||
return $this->belongsTo(Provider::class);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\EnumMatchpart;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OddsDnb extends Model
|
||||
@@ -13,7 +12,6 @@ class OddsDnb extends Model
|
||||
'id',
|
||||
'event_id',
|
||||
'sport_id',
|
||||
'matchpart_id',
|
||||
'bookmaker_id',
|
||||
'provider_id',
|
||||
'dnb1',
|
||||
@@ -25,10 +23,6 @@ class OddsDnb extends Model
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'matchpart_id' => EnumMatchpart::class,
|
||||
];
|
||||
|
||||
public function sport()
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
@@ -39,11 +33,6 @@ class OddsDnb extends Model
|
||||
return $this->belongsTo(Bookmaker::class);
|
||||
}
|
||||
|
||||
public function matchpart()
|
||||
{
|
||||
return $this->belongsTo(Matchpart::class);
|
||||
}
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OddsGgng extends Model
|
||||
{
|
||||
protected $table = 'odds_ggng';
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'event_id',
|
||||
'sport_id',
|
||||
'bookmaker_id',
|
||||
'provider_id',
|
||||
'gg',
|
||||
'ng',
|
||||
'margin',
|
||||
'flag',
|
||||
'check',
|
||||
'add_time',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function sport()
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
}
|
||||
|
||||
public function bookmaker()
|
||||
{
|
||||
return $this->belongsTo(Bookmaker::class);
|
||||
}
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
}
|
||||
|
||||
public function provider()
|
||||
{
|
||||
return $this->belongsTo(Provider::class);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\EnumMatchpart;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OddsHandicap extends Model
|
||||
@@ -13,7 +12,6 @@ class OddsHandicap extends Model
|
||||
'id',
|
||||
'event_id',
|
||||
'sport_id',
|
||||
'matchpart_id',
|
||||
'bookmaker_id',
|
||||
'provider_id',
|
||||
'home',
|
||||
@@ -26,10 +24,6 @@ class OddsHandicap extends Model
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'matchpart_id' => EnumMatchpart::class,
|
||||
];
|
||||
|
||||
public function sport()
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
@@ -40,11 +34,6 @@ class OddsHandicap extends Model
|
||||
return $this->belongsTo(Bookmaker::class);
|
||||
}
|
||||
|
||||
public function matchpart()
|
||||
{
|
||||
return $this->belongsTo(Matchpart::class);
|
||||
}
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
|
||||
@@ -10,7 +10,6 @@ class OddsQualify extends Model
|
||||
'id',
|
||||
'event_id',
|
||||
'sport_id',
|
||||
'matchpart_id',
|
||||
'bookmaker_id',
|
||||
'provider_id',
|
||||
'htq',
|
||||
@@ -22,10 +21,6 @@ class OddsQualify extends Model
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'matchpart_id' => EnumMatchpart::class,
|
||||
];
|
||||
|
||||
public function sport()
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
@@ -36,11 +31,6 @@ class OddsQualify extends Model
|
||||
return $this->belongsTo(Bookmaker::class);
|
||||
}
|
||||
|
||||
public function matchpart()
|
||||
{
|
||||
return $this->belongsTo(Matchpart::class);
|
||||
}
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\EnumMatchpart;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OddsTotal extends Model
|
||||
@@ -13,7 +12,6 @@ class OddsTotal extends Model
|
||||
'id',
|
||||
'event_id',
|
||||
'sport_id',
|
||||
'matchpart_id',
|
||||
'bookmaker_id',
|
||||
'provider_id',
|
||||
'over',
|
||||
@@ -26,10 +24,6 @@ class OddsTotal extends Model
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'matchpart_id' => EnumMatchpart::class,
|
||||
];
|
||||
|
||||
public function sport()
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
@@ -40,11 +34,6 @@ class OddsTotal extends Model
|
||||
return $this->belongsTo(Bookmaker::class);
|
||||
}
|
||||
|
||||
public function matchpart()
|
||||
{
|
||||
return $this->belongsTo(Matchpart::class);
|
||||
}
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
|
||||
@@ -8,14 +8,12 @@ class Supervisor extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'type',
|
||||
'provider_id',
|
||||
'sport_id',
|
||||
'bookmaker_id',
|
||||
'sleep',
|
||||
'limit',
|
||||
'runtime',
|
||||
'events',
|
||||
'maxsconds',
|
||||
'lastcall',
|
||||
'is_cron',
|
||||
'is_active',
|
||||
|
||||
+1
-2
@@ -13,12 +13,11 @@ use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable implements FilamentUser, HasAppAuthentication, HasAppAuthenticationRecovery, HasEmailAuthentication, MustVerifyEmail
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||
use HasFactory, HasRoles, Notifiable;
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Bookmaker;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class BookmakerPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Bookmaker');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Bookmaker $bookmaker): bool
|
||||
{
|
||||
return $authUser->can('View:Bookmaker');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Bookmaker');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Bookmaker $bookmaker): bool
|
||||
{
|
||||
return $authUser->can('Update:Bookmaker');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Bookmaker $bookmaker): bool
|
||||
{
|
||||
return $authUser->can('Delete:Bookmaker');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Bookmaker $bookmaker): bool
|
||||
{
|
||||
return $authUser->can('Restore:Bookmaker');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Bookmaker $bookmaker): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Bookmaker');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Bookmaker');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Bookmaker');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Bookmaker $bookmaker): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Bookmaker');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Bookmaker');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Client;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class ClientPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Client');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Client $client): bool
|
||||
{
|
||||
return $authUser->can('View:Client');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Client');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Client $client): bool
|
||||
{
|
||||
return $authUser->can('Update:Client');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Client $client): bool
|
||||
{
|
||||
return $authUser->can('Delete:Client');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Client $client): bool
|
||||
{
|
||||
return $authUser->can('Restore:Client');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Client $client): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Client');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Client');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Client');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Client $client): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Client');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Client');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Country;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class CountryPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Country');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Country $country): bool
|
||||
{
|
||||
return $authUser->can('View:Country');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Country');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Country $country): bool
|
||||
{
|
||||
return $authUser->can('Update:Country');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Country $country): bool
|
||||
{
|
||||
return $authUser->can('Delete:Country');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Country $country): bool
|
||||
{
|
||||
return $authUser->can('Restore:Country');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Country $country): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Country');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Country');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Country');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Country $country): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Country');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Country');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Event;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class EventPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Event');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Event $event): bool
|
||||
{
|
||||
return $authUser->can('View:Event');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Event');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Event $event): bool
|
||||
{
|
||||
return $authUser->can('Update:Event');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Event $event): bool
|
||||
{
|
||||
return $authUser->can('Delete:Event');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Event $event): bool
|
||||
{
|
||||
return $authUser->can('Restore:Event');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Event $event): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Event');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Event');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Event');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Event $event): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Event');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Event');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Provider;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class ProviderPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Provider');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Provider $provider): bool
|
||||
{
|
||||
return $authUser->can('View:Provider');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Provider');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Provider $provider): bool
|
||||
{
|
||||
return $authUser->can('Update:Provider');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Provider $provider): bool
|
||||
{
|
||||
return $authUser->can('Delete:Provider');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Provider $provider): bool
|
||||
{
|
||||
return $authUser->can('Restore:Provider');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Provider $provider): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Provider');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Provider');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Provider');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Provider $provider): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Provider');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Provider');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use Spatie\Permission\Models\Role;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class RolePolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Role');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Role $role): bool
|
||||
{
|
||||
return $authUser->can('View:Role');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Role');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Role $role): bool
|
||||
{
|
||||
return $authUser->can('Update:Role');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Role $role): bool
|
||||
{
|
||||
return $authUser->can('Delete:Role');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Role $role): bool
|
||||
{
|
||||
return $authUser->can('Restore:Role');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Role $role): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Role');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Role');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Role');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Role $role): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Role');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Role');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Sport;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class SportPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Sport');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Sport $sport): bool
|
||||
{
|
||||
return $authUser->can('View:Sport');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Sport');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Sport $sport): bool
|
||||
{
|
||||
return $authUser->can('Update:Sport');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Sport $sport): bool
|
||||
{
|
||||
return $authUser->can('Delete:Sport');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Sport $sport): bool
|
||||
{
|
||||
return $authUser->can('Restore:Sport');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Sport $sport): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Sport');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Sport');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Sport');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Sport $sport): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Sport');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Sport');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Supervisor;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class SupervisorPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Supervisor');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Supervisor $supervisor): bool
|
||||
{
|
||||
return $authUser->can('View:Supervisor');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Supervisor');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Supervisor $supervisor): bool
|
||||
{
|
||||
return $authUser->can('Update:Supervisor');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Supervisor $supervisor): bool
|
||||
{
|
||||
return $authUser->can('Delete:Supervisor');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Supervisor $supervisor): bool
|
||||
{
|
||||
return $authUser->can('Restore:Supervisor');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Supervisor $supervisor): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Supervisor');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Supervisor');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Supervisor');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Supervisor $supervisor): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Supervisor');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Supervisor');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class UserPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:User');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('View:User');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:User');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Update:User');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Delete:User');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Restore:User');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:User');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:User');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:User');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Replicate:User');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:User');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,7 +27,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
FilamentColor::register([
|
||||
'danger' => Color::Red,
|
||||
'gray' => Color::Zinc,
|
||||
'primary' => Color::Red,
|
||||
'primary' => Color::Blue,
|
||||
'success' => Color::Green,
|
||||
'warning' => Color::Yellow,
|
||||
'info' => Color::Indigo,
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace App\Providers\Filament;
|
||||
|
||||
use Awcodes\LightSwitch\Enums\Alignment;
|
||||
use Awcodes\LightSwitch\LightSwitchPlugin;
|
||||
use BezhanSalleh\FilamentShield\FilamentShieldPlugin;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Auth\MultiFactor\App\AppAuthentication;
|
||||
use Filament\Auth\MultiFactor\Email\EmailAuthentication;
|
||||
@@ -92,10 +91,6 @@ class AdminPanelProvider extends PanelProvider
|
||||
->authMiddleware([
|
||||
Authenticate::class,
|
||||
])->plugins([
|
||||
FilamentShieldPlugin::make()
|
||||
->navigationSort(10)
|
||||
->navigationBadge('3')
|
||||
->globallySearchable(false),
|
||||
FilamentEditProfilePlugin::make()->shouldRegisterNavigation(false),
|
||||
LightSwitchPlugin::make()->position(Alignment::BottomCenter),
|
||||
FilamentBackgroundsPlugin::make()
|
||||
|
||||
Reference in new issue
Block a user