basic comparatore completed
This commit is contained in:
1 parent
cbdc6aff47
commit
16cc214db6
80 files changed
+2413
-2794
No files matched your search
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions;
|
||||
|
||||
use App\Models\MultilineClient;
|
||||
|
||||
class MultilineSlots
|
||||
{
|
||||
public static function loadSlots(&$data)
|
||||
{
|
||||
$slots = MultilineClient::select('bookmaker_id')
|
||||
->where('multiline_setting_id', auth()->user()->multiline_setting_id)
|
||||
->orderBy('sort')
|
||||
->get();
|
||||
|
||||
$multilines = [];
|
||||
|
||||
foreach ($slots as $id => $slot) {
|
||||
$open = true;
|
||||
foreach ($data as $item) {
|
||||
if ($slot->bookmaker_id == $item->bookmaker_id) {
|
||||
$multilines[$id] = $item;
|
||||
$open = false;
|
||||
}
|
||||
}
|
||||
if ($open) {
|
||||
$multilines[$id] = $slot;
|
||||
}
|
||||
}
|
||||
|
||||
return $multilines;
|
||||
}
|
||||
}
|
||||
@@ -53,22 +53,25 @@ class Fixtures
|
||||
|
||||
foreach ($data['results'] as $row) {
|
||||
|
||||
$event = [
|
||||
'sport_id' => (int) $sport_id,
|
||||
'provider_id' => (int) Nuh::$options['provider_id'],
|
||||
'starttime' => Carbon::createFromTimestamp((string) $row['time'])->toDateTimeString(),
|
||||
'home' => $row['home']['name'] ?? '',
|
||||
'home_id' => (int) $row['home']['id'],
|
||||
'home_cc' => $row['home']['cc'] ?? '',
|
||||
'away' => $row['away']['name'] ?? '',
|
||||
'away_id' => (int) $row['away']['id'],
|
||||
'away_cc' => $row['away']['cc'] ?? '',
|
||||
'group' => $row['league']['name'] ?? '',
|
||||
'group_id' => (int) $row['league']['id'] ?? 0,
|
||||
'group_cc' => $row['league']['cc'] ?? '',
|
||||
];
|
||||
if (isset($row['home']['id']) && isset($row['away']['id']) && strpos($row['league']['name'], 'Esoccer') === false) {
|
||||
|
||||
Mapper::updateOrCreate(['event_id' => (int) $row['id']], $event);
|
||||
$event = [
|
||||
'sport_id' => (int) $sport_id,
|
||||
'provider_id' => (int) Nuh::$options['provider_id'],
|
||||
'starttime' => Carbon::createFromTimestamp((string) $row['time'])->toDateTimeString(),
|
||||
'home' => $row['home']['name'] ?? '',
|
||||
'home_id' => (int) $row['home']['id'],
|
||||
'home_cc' => $row['home']['cc'] ?? '',
|
||||
'away' => $row['away']['name'] ?? '',
|
||||
'away_id' => (int) $row['away']['id'],
|
||||
'away_cc' => $row['away']['cc'] ?? '',
|
||||
'group' => $row['league']['name'] ?? '',
|
||||
'group_id' => (int) $row['league']['id'] ?? 0,
|
||||
'group_cc' => $row['league']['cc'] ?? '',
|
||||
];
|
||||
|
||||
Mapper::updateOrCreate(['event_id' => (int) $row['id']], $event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,6 @@ class BettypeResource extends Resource
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Static Data';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return BettypeForm::configure($schema);
|
||||
|
||||
@@ -24,11 +24,6 @@ class BookmakerResource extends Resource
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Static Data';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return BookmakerForm::configure($schema);
|
||||
|
||||
@@ -23,11 +23,6 @@ class ClientResource extends Resource
|
||||
|
||||
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);
|
||||
|
||||
@@ -36,11 +36,6 @@ class CompetitionGroupFilterResource extends Resource
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Comp Groups';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return CompetitionGroupFilterForm::configure($schema);
|
||||
|
||||
@@ -30,11 +30,6 @@ class CountryResource extends Resource
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Static Data';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
|
||||
@@ -36,11 +36,6 @@ class ElementFilterResource extends Resource
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Elements';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return ElementFilterForm::configure($schema);
|
||||
|
||||
@@ -7,10 +7,12 @@ use App\Filament\Tables\Columns\ColumnDc;
|
||||
use App\Filament\Tables\Columns\ColumnDnb;
|
||||
use App\Filament\Tables\Columns\ColumnGgng;
|
||||
use App\Filament\Tables\Columns\ColumnTotal;
|
||||
use App\Filament\Tables\Columns\ColumnTq;
|
||||
use App\Filament\Tables\Columns\MatchIds;
|
||||
use App\Models\BettypeUser;
|
||||
use App\Models\Country;
|
||||
use App\Models\Event;
|
||||
use App\Models\MultilineClient;
|
||||
use Carbon\Carbon;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\ActionGroup;
|
||||
@@ -19,8 +21,8 @@ use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Support\Enums\VerticalAlignment;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\Layout\View;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
@@ -31,6 +33,81 @@ class EventsTable
|
||||
{
|
||||
public static $bettype_settings = [];
|
||||
|
||||
public static $multiline_bookmaker = [];
|
||||
|
||||
public static $odds_3ways = [];
|
||||
|
||||
public static $odds_totals = [];
|
||||
|
||||
public static $odds_totals_q1 = [];
|
||||
|
||||
public static $odds_dc = [];
|
||||
|
||||
public static $odds_dnb = [];
|
||||
|
||||
public static $odds_ggng = [];
|
||||
|
||||
public static $odds_handicaps = [];
|
||||
|
||||
public static $odds_handicaps_q1 = [];
|
||||
|
||||
public static $odds_2ways = [];
|
||||
|
||||
public static $odds_2ways_s1 = [];
|
||||
|
||||
public static $odds_tq = [];
|
||||
|
||||
public static function load_multiline_bookmaker()
|
||||
{
|
||||
$res = MultilineClient::where('client_id', auth()->user()->client_id)->where('sport_id', auth()->user()->sport_id)->select('bookmaker_id', 'multiline_setting_id')->orderBy('multiline_setting_id')->orderBy('sort')->get();
|
||||
|
||||
foreach ($res as $value) {
|
||||
switch ($value->multiline_setting_id) {
|
||||
case 1:
|
||||
case 13:
|
||||
self::$odds_3ways[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 2:
|
||||
self::$odds_dc[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 3:
|
||||
self::$odds_dnb[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 4:
|
||||
self::$odds_ggng[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 5:
|
||||
self::$odds_tq[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 8:
|
||||
case 14:
|
||||
self::$odds_handicaps[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 9:
|
||||
self::$odds_handicaps_q1[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 7:
|
||||
case 12:
|
||||
case 16:
|
||||
self::$odds_2ways[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 17:
|
||||
self::$odds_2ways_s1[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 6:
|
||||
case 10:
|
||||
case 15:
|
||||
case 18:
|
||||
self::$odds_totals[] = $value->bookmaker_id;
|
||||
break;
|
||||
case 11:
|
||||
self::$odds_totals_q1[] = $value->bookmaker_id;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static function load_bettype_settings()
|
||||
{
|
||||
self::$bettype_settings = BettypeUser::where('user_id', auth()->user()->id)->where('sport_id', auth()->user()->sport_id)->where('is_active', 1)->pluck('multiline_setting_id')->toArray();
|
||||
@@ -40,6 +117,8 @@ class EventsTable
|
||||
{
|
||||
self::load_bettype_settings();
|
||||
|
||||
self::load_multiline_bookmaker();
|
||||
|
||||
return $table
|
||||
->striped()
|
||||
->columns([
|
||||
@@ -49,55 +128,86 @@ class EventsTable
|
||||
->color('primary')
|
||||
->width(30)
|
||||
->icon(fn ($record) => $record->sport->icon)
|
||||
->tooltip(fn ($record) => $record->id),
|
||||
// MatchIds::make('match_ids')
|
||||
// ->grow(false),
|
||||
TextColumn::make('id')->hidden()->searchable(),
|
||||
TextColumn::make('betsapi_id')->hidden()->searchable(),
|
||||
TextColumn::make('betradar_id')->hidden()->searchable(),
|
||||
TextColumn::make('bet365_id')->hidden()->searchable(),
|
||||
TextColumn::make('bwin_id')->hidden()->searchable(),
|
||||
->tooltip(fn ($record) => $record->id)
|
||||
->visibleFrom('lg'),
|
||||
|
||||
// MatchIds::make('match_ids')->grow(false)->visibleFrom('xl'),
|
||||
|
||||
TextColumn::make('starttime')
|
||||
->label('Start')
|
||||
->alignCenter()
|
||||
->dateTime('H:i')
|
||||
->weight(FontWeight::Bold)
|
||||
->description(fn ($state): string => Carbon::createFromDate($state)->format('d. M')),
|
||||
|
||||
TextColumn::make('country.name')
|
||||
->width('20rem')
|
||||
->searchable()
|
||||
->wrap()
|
||||
->color('gray')
|
||||
->label('Event')
|
||||
->icon(fn ($record) => $record->country->icon)
|
||||
->description(fn ($record) => $record->competition_group->name),
|
||||
|
||||
TextColumn::make('home.name')
|
||||
->wrap()
|
||||
->searchable()
|
||||
->alignRight(),
|
||||
|
||||
TextColumn::make('away.name')
|
||||
->wrap()
|
||||
->searchable(),
|
||||
Column3way::make('odds3way')->visible(fn () => in_array(1, self::$bettype_settings))->width(225)->label('1 X 2'),
|
||||
ColumnDc::make('oddsdc')->visible(fn () => in_array(2, self::$bettype_settings))->width(225)->label('Double Chance'),
|
||||
ColumnDnb::make('oddsdnb')->visible(fn () => in_array(3, self::$bettype_settings))->width(190)->label('Draw No Bet'),
|
||||
ColumnGgng::make('oddsggng')->visible(fn () => in_array(4, self::$bettype_settings))->width(190)->label('Goal No Goal'),
|
||||
ColumnGgng::make('oddstq')->visible(fn () => in_array(5, self::$bettype_settings))->width(190)->label('To Qualify'),
|
||||
ColumnTotal::make('oddstotal')->visible(fn () => in_array(6, self::$bettype_settings))->width(225)->label('Totals'),
|
||||
|
||||
// Column3way::make('odds3way')->visible(fn () => in_array(1, self::$bettype_settings))->width(225)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => '1x2'])),
|
||||
// ColumnDc::make('oddsdc')->visible(fn () => in_array(2, self::$bettype_settings))->width(225)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => 'dc'])),
|
||||
// ColumnDnb::make('oddsdnb')->visible(fn () => in_array(3, self::$bettype_settings))->width(190)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => 'dnb'])),
|
||||
// ColumnGgng::make('oddsggng')->visible(fn () => in_array(4, self::$bettype_settings))->width(190)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => 'gg'])),
|
||||
// ColumnGgng::make('oddstq')->visible(fn () => in_array(5, self::$bettype_settings))->width(190)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => 'tq'])),
|
||||
// ColumnTotal::make('oddstotal')->visible(fn () => in_array(6, self::$bettype_settings))->width(225)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => 'ou'])),
|
||||
])
|
||||
Column3way::make('odds3way')->bookmakers(self::$odds_3ways)
|
||||
->visible(fn () => in_array(1, self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->width(225)
|
||||
->label('1 X 2')
|
||||
->extraCellAttributes(['class' => 'border-l border-gray-200 dark:border-gray-800']),
|
||||
|
||||
ColumnDc::make('oddsdc')->bookmakers(self::$odds_dc)
|
||||
->visible(fn () => in_array(2, self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->width(225)
|
||||
->label('Double Chance')
|
||||
->extraCellAttributes(['class' => 'border-l border-gray-200 dark:border-gray-800']),
|
||||
|
||||
ColumnDnb::make('oddsdnb')->bookmakers(self::$odds_dnb)
|
||||
->visible(fn () => in_array(3, self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->width(190)
|
||||
->label('Draw No Bet')
|
||||
->extraCellAttributes(['class' => 'border-l border-gray-200 dark:border-gray-800']),
|
||||
|
||||
ColumnGgng::make('oddsggng')->bookmakers(self::$odds_ggng)
|
||||
->visible(fn () => in_array(4, self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->width(190)
|
||||
->label('Goal No Goal')
|
||||
->extraCellAttributes(['class' => 'border-l border-gray-200 dark:border-gray-800']),
|
||||
|
||||
ColumnTq::make('oddstq')->bookmakers(self::$odds_tq)
|
||||
->visible(fn () => in_array(5, self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->width(190)
|
||||
->label('To Qualify')
|
||||
->extraCellAttributes(['class' => 'border-l border-gray-200 dark:border-gray-800']),
|
||||
|
||||
ColumnTotal::make('oddstotal')->bookmakers(self::$odds_totals)
|
||||
->visible(fn () => in_array(6, self::$bettype_settings))
|
||||
->verticalAlignment(VerticalAlignment::Start)
|
||||
->width(225)
|
||||
->label('Totals')
|
||||
->extraCellAttributes(['class' => 'border-l border-gray-200 dark:border-gray-800']),
|
||||
])->searchable(['id', 'betsapi_id', 'betradar_id', 'bet365_id', 'bwin_id'])
|
||||
->poll('10s')
|
||||
->defaultSort('starttime', 'ASC')
|
||||
->filters([
|
||||
Filter::make('events')
|
||||
->schema([
|
||||
Select::make('country_id')
|
||||
->label('Country')
|
||||
->placeholder('Country')
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->searchable()
|
||||
->preload()
|
||||
->options(function () {
|
||||
@@ -111,7 +221,9 @@ class EventsTable
|
||||
$set('competition_group_id', null);
|
||||
}),
|
||||
Select::make('competition_group_id')
|
||||
->label('League')
|
||||
->placeholder('League')
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->multiple()
|
||||
->columnSpan(2)
|
||||
->searchable()
|
||||
@@ -149,10 +261,10 @@ class EventsTable
|
||||
->recordActions([
|
||||
ActionGroup::make([
|
||||
// EditAction::make(),
|
||||
// DeleteAction::make(),
|
||||
DeleteAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')),
|
||||
Action::make('txodds_odds')
|
||||
->label('TxOdds')
|
||||
->disabled(fn () => ! auth()->user()->super_admin)
|
||||
->disabled(fn () => ! auth()->user()->hasRole('super_admin'))
|
||||
->icon('heroicon-o-arrow-top-right-on-square')
|
||||
->url(fn ($record): string => route('txodds_odds', ['sportid' => $record->sport_id, 'txoddsid' => $record->id]))
|
||||
->openUrlInNewTab(),
|
||||
|
||||
@@ -33,11 +33,6 @@ class GroupFilterResource extends Resource
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Groups';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return GroupFilterForm::configure($schema);
|
||||
|
||||
@@ -13,9 +13,7 @@ class ListMultilineClients extends ListRecords
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
// CreateAction::make()
|
||||
// ->createAnother(false)
|
||||
// ->hidden(! auth()->user()->super_admin),
|
||||
// CreateAction::make()->createAnother(false),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -27,11 +27,6 @@ class ProviderResource extends Resource
|
||||
|
||||
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
|
||||
{
|
||||
return ProviderForm::configure($schema);
|
||||
|
||||
@@ -28,11 +28,6 @@ class SportResource extends Resource
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Static Data';
|
||||
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
return auth()->user()->super_admin == 1;
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
|
||||
@@ -23,11 +23,6 @@ class SupervisorResource extends Resource
|
||||
|
||||
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
|
||||
{
|
||||
return SupervisorForm::configure($schema);
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
namespace App\Filament\Resources\Users\Schemas;
|
||||
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use App\Models\Bookmaker;
|
||||
use App\Models\Client;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Schema;
|
||||
@@ -19,14 +20,22 @@ class UserForm
|
||||
->label('Email address')
|
||||
->email()
|
||||
->required(),
|
||||
// DateTimePicker::make('email_verified_at'),
|
||||
// TextInput::make('password')
|
||||
// ->password()
|
||||
// ->required(),
|
||||
Select::make('client_id')
|
||||
->relationship('client', 'name')
|
||||
->preload(),
|
||||
Select::make('bookmaker_id')
|
||||
->label('Active Bookmaker')
|
||||
->options(function () {
|
||||
$bookmaker = Client::where('id', auth()->user()->client_id)->value('bookmaker');
|
||||
|
||||
return Bookmaker::query()->whereIn('id', $bookmaker)->pluck('name', 'id');
|
||||
})
|
||||
->preload(),
|
||||
Select::make('roles')
|
||||
->label('Rollen')
|
||||
->prefixIcon('phosphor-gear')
|
||||
->aboveContent('Only visible for super_admin')
|
||||
->visible(fn () => auth()->user()->hasRole('super_admin'))
|
||||
->relationship('roles', 'name')
|
||||
->multiple()
|
||||
->preload()
|
||||
|
||||
@@ -20,6 +20,8 @@ class UsersTable
|
||||
->label('Email address')
|
||||
->searchable(),
|
||||
TextColumn::make('client.name')->badge(),
|
||||
TextColumn::make('roles.name')->badge()->color('success')->wrap(),
|
||||
TextColumn::make('bookmaker.name')->badge()->color('warning'),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
||||
@@ -25,11 +25,6 @@ class UserResource extends Resource
|
||||
|
||||
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);
|
||||
|
||||
@@ -9,46 +9,38 @@ class Column3way extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column_3way';
|
||||
|
||||
protected ?array $multiline;
|
||||
protected $data;
|
||||
|
||||
protected ?array $fumetto;
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected ?bool $has_odds;
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function loadData($record, $multiline_client)
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
$res = Odds3way::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->fumetto = [];
|
||||
|
||||
$this->multiline = [];
|
||||
|
||||
foreach ($res as $item) {
|
||||
|
||||
$this->fumetto[] = $item;
|
||||
foreach ($multiline_client as $slot => $bookmaker) {
|
||||
if ($item->bookmaker_id == $bookmaker->bookmaker_id) {
|
||||
$this->multiline[$slot] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->has_odds = count($this->multiline) ? true : false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getData(): ?array
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->multiline;
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function getFumetto()
|
||||
public function loadData($record)
|
||||
{
|
||||
return $this->fumetto;
|
||||
$this->data = Odds3way::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->has_data = count($this->data) ? true : false;
|
||||
}
|
||||
|
||||
public function hasodds()
|
||||
public function getData()
|
||||
{
|
||||
return $this->has_odds;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function hasData()
|
||||
{
|
||||
return $this->has_data;
|
||||
}
|
||||
}
|
||||
@@ -9,46 +9,38 @@ class ColumnDc extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-dc';
|
||||
|
||||
protected ?array $multiline;
|
||||
protected $data;
|
||||
|
||||
protected ?array $fumetto;
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected ?bool $has_odds;
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function loadData($record, $multiline_client)
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
$res = OddsDc::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->fumetto = [];
|
||||
|
||||
$this->multiline = [];
|
||||
|
||||
foreach ($res as $item) {
|
||||
|
||||
$this->fumetto[] = $item;
|
||||
foreach ($multiline_client as $slot => $bookmaker) {
|
||||
if ($item->bookmaker_id == $bookmaker->bookmaker_id) {
|
||||
$this->multiline[$slot] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->has_odds = count($this->multiline) ? true : false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getData(): ?array
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->multiline;
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function getFumetto()
|
||||
public function loadData($record)
|
||||
{
|
||||
return $this->fumetto;
|
||||
$this->data = OddsDc::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->has_data = count($this->data) ? true : false;
|
||||
}
|
||||
|
||||
public function hasodds()
|
||||
public function getData()
|
||||
{
|
||||
return $this->has_odds;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function hasData()
|
||||
{
|
||||
return $this->has_data;
|
||||
}
|
||||
}
|
||||
@@ -9,46 +9,38 @@ class ColumnDnb extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-dnb';
|
||||
|
||||
protected ?array $multiline;
|
||||
protected $data;
|
||||
|
||||
protected ?array $fumetto;
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected ?bool $has_odds;
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function loadData($record, $multiline_client)
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
$res = OddsDnb::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->fumetto = [];
|
||||
|
||||
$this->multiline = [];
|
||||
|
||||
foreach ($res as $item) {
|
||||
|
||||
$this->fumetto[] = $item;
|
||||
foreach ($multiline_client as $slot => $bookmaker) {
|
||||
if ($item->bookmaker_id == $bookmaker->bookmaker_id) {
|
||||
$this->multiline[$slot] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->has_odds = count($this->multiline) ? true : false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getData(): ?array
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->multiline;
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function getFumetto()
|
||||
public function loadData($record)
|
||||
{
|
||||
return $this->fumetto;
|
||||
$this->data = OddsDnb::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->has_data = count($this->data) ? true : false;
|
||||
}
|
||||
|
||||
public function hasodds()
|
||||
public function getData()
|
||||
{
|
||||
return $this->has_odds;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function hasData()
|
||||
{
|
||||
return $this->has_data;
|
||||
}
|
||||
}
|
||||
@@ -9,46 +9,38 @@ class ColumnGgng extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-ggng';
|
||||
|
||||
protected ?array $multiline;
|
||||
protected $data;
|
||||
|
||||
protected ?array $fumetto;
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected ?bool $has_odds;
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function loadData($record, $multiline_client)
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
$res = OddsGgng::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->fumetto = [];
|
||||
|
||||
$this->multiline = [];
|
||||
|
||||
foreach ($res as $item) {
|
||||
|
||||
$this->fumetto[] = $item;
|
||||
foreach ($multiline_client as $slot => $bookmaker) {
|
||||
if ($item->bookmaker_id == $bookmaker->bookmaker_id) {
|
||||
$this->multiline[$slot] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->has_odds = count($this->multiline) ? true : false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getData(): ?array
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->multiline;
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function getFumetto()
|
||||
public function loadData($record)
|
||||
{
|
||||
return $this->fumetto;
|
||||
$this->data = OddsGgng::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->has_data = count($this->data) ? true : false;
|
||||
}
|
||||
|
||||
public function hasodds()
|
||||
public function getData()
|
||||
{
|
||||
return $this->has_odds;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function hasData()
|
||||
{
|
||||
return $this->has_data;
|
||||
}
|
||||
}
|
||||
@@ -9,46 +9,38 @@ class ColumnTotal extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-total';
|
||||
|
||||
protected ?array $multiline;
|
||||
protected $data;
|
||||
|
||||
protected ?array $fumetto;
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected ?bool $has_odds;
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function loadData($record, $multiline_client)
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
$res = OddsTotal::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->fumetto = [];
|
||||
|
||||
$this->multiline = [];
|
||||
|
||||
foreach ($res as $item) {
|
||||
|
||||
$this->fumetto[] = $item;
|
||||
foreach ($multiline_client as $slot => $bookmaker) {
|
||||
if ($item->bookmaker_id == $bookmaker->bookmaker_id) {
|
||||
$this->multiline[$slot] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->has_odds = count($this->multiline) ? true : false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getData(): ?array
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->multiline;
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function getFumetto()
|
||||
public function loadData($record)
|
||||
{
|
||||
return $this->fumetto;
|
||||
$this->data = OddsTotal::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->has_data = count($this->data) ? true : false;
|
||||
}
|
||||
|
||||
public function hasodds()
|
||||
public function getData()
|
||||
{
|
||||
return $this->has_odds;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function hasData()
|
||||
{
|
||||
return $this->has_data;
|
||||
}
|
||||
}
|
||||
@@ -9,46 +9,38 @@ class ColumnTq extends Column
|
||||
{
|
||||
protected string $view = 'filament.tables.columns.column-tq';
|
||||
|
||||
protected ?array $multiline;
|
||||
protected $data;
|
||||
|
||||
protected ?array $fumetto;
|
||||
protected ?array $bookmakers;
|
||||
|
||||
protected ?bool $has_odds;
|
||||
protected ?bool $has_data;
|
||||
|
||||
public function loadData($record, $multiline_client)
|
||||
public function bookmakers(?array $bookmakers): static
|
||||
{
|
||||
$this->bookmakers = $bookmakers;
|
||||
|
||||
$res = OddsQualify::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->fumetto = [];
|
||||
|
||||
$this->multiline = [];
|
||||
|
||||
foreach ($res as $item) {
|
||||
|
||||
$this->fumetto[] = $item;
|
||||
foreach ($multiline_client as $slot => $bookmaker) {
|
||||
if ($item->bookmaker_id == $bookmaker->bookmaker_id) {
|
||||
$this->multiline[$slot] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->has_odds = count($this->multiline) ? true : false;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getData(): ?array
|
||||
public function getBookmaker(): ?array
|
||||
{
|
||||
return $this->multiline;
|
||||
return $this->bookmakers;
|
||||
}
|
||||
|
||||
public function getFumetto()
|
||||
public function loadData($record)
|
||||
{
|
||||
return $this->fumetto;
|
||||
$this->data = OddsQualify::with('bookmaker')->where('event_id', $record->id)->get();
|
||||
|
||||
$this->has_data = count($this->data) ? true : false;
|
||||
}
|
||||
|
||||
public function hasodds()
|
||||
public function getData()
|
||||
{
|
||||
return $this->has_odds;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function hasData()
|
||||
{
|
||||
return $this->has_data;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Mapper;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
use Filament\Schemas\Concerns\InteractsWithSchemas;
|
||||
use Filament\Schemas\Contracts\HasSchemas;
|
||||
use Filament\Support\Enums\TextSize;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Concerns\InteractsWithTable;
|
||||
use Filament\Tables\Contracts\HasTable;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Livewire\Component;
|
||||
|
||||
class MapperClients extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
use InteractsWithActions;
|
||||
use InteractsWithSchemas;
|
||||
use InteractsWithTable;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(fn (): Builder => Mapper::query())
|
||||
->columns([
|
||||
TextColumn::make('home')->searchable()->alignRight()->size(TextSize::ExtraSmall),
|
||||
TextColumn::make('away')->searchable()->size(TextSize::ExtraSmall),
|
||||
TextColumn::make('group')->searchable()->wrap()->size(TextSize::ExtraSmall)->label('League'),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
//
|
||||
])
|
||||
->recordActions([
|
||||
//
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
//
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function render(): View
|
||||
{
|
||||
return view('livewire.mapper-clients');
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Event;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
use Filament\Schemas\Concerns\InteractsWithSchemas;
|
||||
use Filament\Schemas\Contracts\HasSchemas;
|
||||
use Filament\Support\Enums\TextSize;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Concerns\InteractsWithTable;
|
||||
use Filament\Tables\Contracts\HasTable;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Livewire\Component;
|
||||
|
||||
class MapperEvents extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
use InteractsWithActions;
|
||||
use InteractsWithSchemas;
|
||||
use InteractsWithTable;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(fn (): Builder => Event::query())
|
||||
->columns([
|
||||
// TextColumn::make('country.name')
|
||||
// ->color('gray')
|
||||
// ->label('Event')
|
||||
// ->icon(fn ($record) => $record->country->icon)
|
||||
// ->description(fn ($record) => $record->competition_group->name)
|
||||
// ->wrap(),
|
||||
TextColumn::make('competition_group.name')->searchable()->wrap()->size(TextSize::ExtraSmall)->label('League'),
|
||||
TextColumn::make('home.name')->searchable()->alignRight()->size(TextSize::ExtraSmall),
|
||||
TextColumn::make('away.name')->searchable()->size(TextSize::ExtraSmall),
|
||||
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->headerActions([
|
||||
//
|
||||
])
|
||||
->recordActions([
|
||||
//
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
//
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function render(): View
|
||||
{
|
||||
return view('livewire.mapper-events');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Event;
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
use Filament\Schemas\Concerns\InteractsWithSchemas;
|
||||
use Filament\Schemas\Contracts\HasSchemas;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Concerns\InteractsWithTable;
|
||||
use Filament\Tables\Contracts\HasTable;
|
||||
use Filament\Tables\Table;
|
||||
use Livewire\Component;
|
||||
|
||||
class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
use InteractsWithActions;
|
||||
use InteractsWithSchemas;
|
||||
use InteractsWithTable;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(Event::query())
|
||||
->columns([
|
||||
TextColumn::make('name'),
|
||||
])
|
||||
->filters([
|
||||
// ...
|
||||
])
|
||||
->recordActions([
|
||||
// ...
|
||||
])
|
||||
->toolbarActions([
|
||||
// ...
|
||||
]);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.mapper-left');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Mapper;
|
||||
use Filament\Actions\Concerns\InteractsWithActions;
|
||||
use Filament\Actions\Contracts\HasActions;
|
||||
use Filament\Schemas\Concerns\InteractsWithSchemas;
|
||||
use Filament\Schemas\Contracts\HasSchemas;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Concerns\InteractsWithTable;
|
||||
use Filament\Tables\Contracts\HasTable;
|
||||
use Filament\Tables\Table;
|
||||
use Livewire\Component;
|
||||
|
||||
class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
use InteractsWithActions;
|
||||
use InteractsWithSchemas;
|
||||
use InteractsWithTable;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->query(Mapper::query())
|
||||
->columns([
|
||||
TextColumn::make('name'),
|
||||
])
|
||||
->filters([
|
||||
// ...
|
||||
])
|
||||
->recordActions([
|
||||
// ...
|
||||
])
|
||||
->toolbarActions([
|
||||
// ...
|
||||
]);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.mapper-left');
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,11 @@ class TopMenuItems extends Component
|
||||
|
||||
public function swop($client_id)
|
||||
{
|
||||
User::where('id', auth()->user()->id)->update(['client_id' => $client_id]);
|
||||
$bookmakers = Client::where('id', $client_id)->pluck('bookmaker')->first();
|
||||
|
||||
$bookmaker_id = array_shift($bookmakers);
|
||||
|
||||
User::where('id', auth()->user()->id)->update(['bookmaker_id' => $bookmaker_id, 'client_id' => $client_id]);
|
||||
|
||||
$this->js('window.location.reload()');
|
||||
}
|
||||
|
||||
@@ -52,9 +52,4 @@ class Event extends Model
|
||||
{
|
||||
return $this->hasOne(Element::class, 'id', 'away_id');
|
||||
}
|
||||
|
||||
public function multiline_client()
|
||||
{
|
||||
return $this->hasMany(MultilineClient::class, 'sport_id', 'sport_id')->with('bookmaker')->where('multiline_setting_id', auth()->user()->multiline_setting_id)->orderBy('sort');
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -13,11 +13,12 @@ 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, Notifiable;
|
||||
use HasFactory, HasRoles, Notifiable;
|
||||
|
||||
protected $casts = [
|
||||
'bettype_status' => 'json',
|
||||
@@ -36,7 +37,9 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
||||
'agb_akzeptiert',
|
||||
'app_verified_at',
|
||||
'bettype_status',
|
||||
'client_id',
|
||||
'sport_id',
|
||||
'bookmaker_id',
|
||||
];
|
||||
|
||||
protected static function newFactory(): Factory
|
||||
@@ -152,6 +155,11 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
||||
return $this->belongsTo(Client::class);
|
||||
}
|
||||
|
||||
public function bookmaker()
|
||||
{
|
||||
return $this->belongsTo(Bookmaker::class);
|
||||
}
|
||||
|
||||
public function bettype_user()
|
||||
{
|
||||
return $this->hasMany(BettypeUser::class)->where('sport_id', auth()->user()->sport_id);
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\Bettype;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class BettypePolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:Bettype');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, Bettype $bettype): bool
|
||||
{
|
||||
return $authUser->can('View:Bettype');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:Bettype');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, Bettype $bettype): bool
|
||||
{
|
||||
return $authUser->can('Update:Bettype');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, Bettype $bettype): bool
|
||||
{
|
||||
return $authUser->can('Delete:Bettype');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, Bettype $bettype): bool
|
||||
{
|
||||
return $authUser->can('Restore:Bettype');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, Bettype $bettype): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:Bettype');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:Bettype');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:Bettype');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, Bettype $bettype): bool
|
||||
{
|
||||
return $authUser->can('Replicate:Bettype');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:Bettype');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\CompetitionGroupFilter;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class CompetitionGroupFilterPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, CompetitionGroupFilter $competitionGroupFilter): bool
|
||||
{
|
||||
return $authUser->can('View:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, CompetitionGroupFilter $competitionGroupFilter): bool
|
||||
{
|
||||
return $authUser->can('Update:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, CompetitionGroupFilter $competitionGroupFilter): bool
|
||||
{
|
||||
return $authUser->can('Delete:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, CompetitionGroupFilter $competitionGroupFilter): bool
|
||||
{
|
||||
return $authUser->can('Restore:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, CompetitionGroupFilter $competitionGroupFilter): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, CompetitionGroupFilter $competitionGroupFilter): bool
|
||||
{
|
||||
return $authUser->can('Replicate:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:CompetitionGroupFilter');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\ElementFilter;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class ElementFilterPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:ElementFilter');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, ElementFilter $elementFilter): bool
|
||||
{
|
||||
return $authUser->can('View:ElementFilter');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:ElementFilter');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, ElementFilter $elementFilter): bool
|
||||
{
|
||||
return $authUser->can('Update:ElementFilter');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, ElementFilter $elementFilter): bool
|
||||
{
|
||||
return $authUser->can('Delete:ElementFilter');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, ElementFilter $elementFilter): bool
|
||||
{
|
||||
return $authUser->can('Restore:ElementFilter');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, ElementFilter $elementFilter): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:ElementFilter');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:ElementFilter');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:ElementFilter');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, ElementFilter $elementFilter): bool
|
||||
{
|
||||
return $authUser->can('Replicate:ElementFilter');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:ElementFilter');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\GroupFilter;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class GroupFilterPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:GroupFilter');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, GroupFilter $groupFilter): bool
|
||||
{
|
||||
return $authUser->can('View:GroupFilter');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:GroupFilter');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, GroupFilter $groupFilter): bool
|
||||
{
|
||||
return $authUser->can('Update:GroupFilter');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, GroupFilter $groupFilter): bool
|
||||
{
|
||||
return $authUser->can('Delete:GroupFilter');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, GroupFilter $groupFilter): bool
|
||||
{
|
||||
return $authUser->can('Restore:GroupFilter');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, GroupFilter $groupFilter): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:GroupFilter');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:GroupFilter');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:GroupFilter');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, GroupFilter $groupFilter): bool
|
||||
{
|
||||
return $authUser->can('Replicate:GroupFilter');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:GroupFilter');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\MultilineClient;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class MultilineClientPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:MultilineClient');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, MultilineClient $multilineClient): bool
|
||||
{
|
||||
return $authUser->can('View:MultilineClient');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:MultilineClient');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, MultilineClient $multilineClient): bool
|
||||
{
|
||||
return $authUser->can('Update:MultilineClient');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, MultilineClient $multilineClient): bool
|
||||
{
|
||||
return $authUser->can('Delete:MultilineClient');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, MultilineClient $multilineClient): bool
|
||||
{
|
||||
return $authUser->can('Restore:MultilineClient');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, MultilineClient $multilineClient): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:MultilineClient');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:MultilineClient');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:MultilineClient');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, MultilineClient $multilineClient): bool
|
||||
{
|
||||
return $authUser->can('Replicate:MultilineClient');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:MultilineClient');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||
use App\Models\MultilineSetting;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class MultilineSettingPolicy
|
||||
{
|
||||
use HandlesAuthorization;
|
||||
|
||||
public function viewAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ViewAny:MultilineSetting');
|
||||
}
|
||||
|
||||
public function view(AuthUser $authUser, MultilineSetting $multilineSetting): bool
|
||||
{
|
||||
return $authUser->can('View:MultilineSetting');
|
||||
}
|
||||
|
||||
public function create(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Create:MultilineSetting');
|
||||
}
|
||||
|
||||
public function update(AuthUser $authUser, MultilineSetting $multilineSetting): bool
|
||||
{
|
||||
return $authUser->can('Update:MultilineSetting');
|
||||
}
|
||||
|
||||
public function delete(AuthUser $authUser, MultilineSetting $multilineSetting): bool
|
||||
{
|
||||
return $authUser->can('Delete:MultilineSetting');
|
||||
}
|
||||
|
||||
public function restore(AuthUser $authUser, MultilineSetting $multilineSetting): bool
|
||||
{
|
||||
return $authUser->can('Restore:MultilineSetting');
|
||||
}
|
||||
|
||||
public function forceDelete(AuthUser $authUser, MultilineSetting $multilineSetting): bool
|
||||
{
|
||||
return $authUser->can('ForceDelete:MultilineSetting');
|
||||
}
|
||||
|
||||
public function forceDeleteAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('ForceDeleteAny:MultilineSetting');
|
||||
}
|
||||
|
||||
public function restoreAny(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('RestoreAny:MultilineSetting');
|
||||
}
|
||||
|
||||
public function replicate(AuthUser $authUser, MultilineSetting $multilineSetting): bool
|
||||
{
|
||||
return $authUser->can('Replicate:MultilineSetting');
|
||||
}
|
||||
|
||||
public function reorder(AuthUser $authUser): bool
|
||||
{
|
||||
return $authUser->can('Reorder:MultilineSetting');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Providers\Filament;
|
||||
|
||||
use Agencetwogether\HooksHelper\HooksHelperPlugin;
|
||||
use BezhanSalleh\FilamentShield\FilamentShieldPlugin;
|
||||
use Awcodes\LightSwitch\Enums\Alignment;
|
||||
use Awcodes\LightSwitch\LightSwitchPlugin;
|
||||
use Filament\Actions\Action;
|
||||
@@ -67,6 +68,7 @@ class AdminPanelProvider extends PanelProvider
|
||||
// Dashboard::class,
|
||||
])
|
||||
->maxContentWidth(Width::ScreenTwoExtraLarge)
|
||||
// ->maxContentWidth(Width::Full)
|
||||
->breadcrumbs(false)
|
||||
->topNavigation()
|
||||
->userMenuItems([
|
||||
@@ -94,6 +96,7 @@ class AdminPanelProvider extends PanelProvider
|
||||
->authMiddleware([
|
||||
Authenticate::class,
|
||||
])->plugins([
|
||||
FilamentShieldPlugin::make(),
|
||||
HooksHelperPlugin::make(),
|
||||
FilamentEditProfilePlugin::make()->shouldRegisterNavigation(false),
|
||||
LightSwitchPlugin::make()->position(Alignment::BottomCenter),
|
||||
|
||||
Reference in new issue
Block a user