basic comparatore completed

This commit is contained in:
salam committed 2025-12-26 10:42:51 +01:00
1 parent cbdc6aff47
commit 16cc214db6
80 files changed
+2413 -2794

No files matched your search

-33
View File
@@ -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) { foreach ($data['results'] as $row) {
$event = [ if (isset($row['home']['id']) && isset($row['away']['id']) && strpos($row['league']['name'], 'Esoccer') === false) {
'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); $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'; 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 public static function form(Schema $schema): Schema
{ {
return BettypeForm::configure($schema); return BettypeForm::configure($schema);
@@ -24,11 +24,6 @@ class BookmakerResource extends Resource
protected static string|\UnitEnum|null $navigationGroup = 'Static Data'; 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 public static function form(Schema $schema): Schema
{ {
return BookmakerForm::configure($schema); return BookmakerForm::configure($schema);
@@ -23,11 +23,6 @@ class ClientResource extends Resource
protected static string|\UnitEnum|null $navigationGroup = 'User'; 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 public static function form(Schema $schema): Schema
{ {
return ClientForm::configure($schema); return ClientForm::configure($schema);
@@ -36,11 +36,6 @@ class CompetitionGroupFilterResource extends Resource
protected static ?string $pluralModelLabel = 'Comp Groups'; protected static ?string $pluralModelLabel = 'Comp Groups';
public static function canViewAny(): bool
{
return auth()->user()->super_admin == 1;
}
public static function form(Schema $schema): Schema public static function form(Schema $schema): Schema
{ {
return CompetitionGroupFilterForm::configure($schema); return CompetitionGroupFilterForm::configure($schema);
@@ -30,11 +30,6 @@ class CountryResource extends Resource
protected static string|\UnitEnum|null $navigationGroup = 'Static Data'; 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 public static function form(Schema $schema): Schema
{ {
return $schema return $schema
@@ -36,11 +36,6 @@ class ElementFilterResource extends Resource
protected static ?string $pluralModelLabel = 'Elements'; protected static ?string $pluralModelLabel = 'Elements';
public static function canViewAny(): bool
{
return auth()->user()->super_admin == 1;
}
public static function form(Schema $schema): Schema public static function form(Schema $schema): Schema
{ {
return ElementFilterForm::configure($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\ColumnDnb;
use App\Filament\Tables\Columns\ColumnGgng; use App\Filament\Tables\Columns\ColumnGgng;
use App\Filament\Tables\Columns\ColumnTotal; use App\Filament\Tables\Columns\ColumnTotal;
use App\Filament\Tables\Columns\ColumnTq;
use App\Filament\Tables\Columns\MatchIds; use App\Filament\Tables\Columns\MatchIds;
use App\Models\BettypeUser; use App\Models\BettypeUser;
use App\Models\Country; use App\Models\Country;
use App\Models\Event; use App\Models\Event;
use App\Models\MultilineClient;
use Carbon\Carbon; use Carbon\Carbon;
use Filament\Actions\Action; use Filament\Actions\Action;
use Filament\Actions\ActionGroup; use Filament\Actions\ActionGroup;
@@ -19,8 +21,8 @@ use Filament\Actions\EditAction;
use Filament\Forms\Components\Select; use Filament\Forms\Components\Select;
use Filament\Schemas\Components\Utilities\Get; use Filament\Schemas\Components\Utilities\Get;
use Filament\Support\Enums\FontWeight; use Filament\Support\Enums\FontWeight;
use Filament\Support\Enums\VerticalAlignment;
use Filament\Tables\Columns\IconColumn; use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\Layout\View;
use Filament\Tables\Columns\TextColumn; use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Enums\FiltersLayout; use Filament\Tables\Enums\FiltersLayout;
use Filament\Tables\Filters\Filter; use Filament\Tables\Filters\Filter;
@@ -31,6 +33,81 @@ class EventsTable
{ {
public static $bettype_settings = []; 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() 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(); 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_bettype_settings();
self::load_multiline_bookmaker();
return $table return $table
->striped() ->striped()
->columns([ ->columns([
@@ -49,55 +128,86 @@ class EventsTable
->color('primary') ->color('primary')
->width(30) ->width(30)
->icon(fn ($record) => $record->sport->icon) ->icon(fn ($record) => $record->sport->icon)
->tooltip(fn ($record) => $record->id), ->tooltip(fn ($record) => $record->id)
// MatchIds::make('match_ids') ->visibleFrom('lg'),
// ->grow(false),
TextColumn::make('id')->hidden()->searchable(), // MatchIds::make('match_ids')->grow(false)->visibleFrom('xl'),
TextColumn::make('betsapi_id')->hidden()->searchable(),
TextColumn::make('betradar_id')->hidden()->searchable(),
TextColumn::make('bet365_id')->hidden()->searchable(),
TextColumn::make('bwin_id')->hidden()->searchable(),
TextColumn::make('starttime') TextColumn::make('starttime')
->label('Start') ->label('Start')
->alignCenter() ->alignCenter()
->dateTime('H:i') ->dateTime('H:i')
->weight(FontWeight::Bold) ->weight(FontWeight::Bold)
->description(fn ($state): string => Carbon::createFromDate($state)->format('d. M')), ->description(fn ($state): string => Carbon::createFromDate($state)->format('d. M')),
TextColumn::make('country.name') TextColumn::make('country.name')
->width('20rem')
->searchable() ->searchable()
->wrap()
->color('gray') ->color('gray')
->label('Event') ->label('Event')
->icon(fn ($record) => $record->country->icon) ->icon(fn ($record) => $record->country->icon)
->description(fn ($record) => $record->competition_group->name), ->description(fn ($record) => $record->competition_group->name),
TextColumn::make('home.name') TextColumn::make('home.name')
->wrap() ->wrap()
->searchable() ->searchable()
->alignRight(), ->alignRight(),
TextColumn::make('away.name') TextColumn::make('away.name')
->wrap() ->wrap()
->searchable(), ->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'])), Column3way::make('odds3way')->bookmakers(self::$odds_3ways)
// ColumnDc::make('oddsdc')->visible(fn () => in_array(2, self::$bettype_settings))->width(225)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => 'dc'])), ->visible(fn () => in_array(1, self::$bettype_settings))
// ColumnDnb::make('oddsdnb')->visible(fn () => in_array(3, self::$bettype_settings))->width(190)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => 'dnb'])), ->verticalAlignment(VerticalAlignment::Start)
// ColumnGgng::make('oddsggng')->visible(fn () => in_array(4, self::$bettype_settings))->width(190)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => 'gg'])), ->width(225)
// ColumnGgng::make('oddstq')->visible(fn () => in_array(5, self::$bettype_settings))->width(190)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => 'tq'])), ->label('1 X 2')
// ColumnTotal::make('oddstotal')->visible(fn () => in_array(6, self::$bettype_settings))->width(225)->label(fn () => view('filament.tables.columns.multiline.labels', ['menu' => 'ou'])), ->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') ->poll('10s')
->defaultSort('starttime', 'ASC') ->defaultSort('starttime', 'ASC')
->filters([ ->filters([
Filter::make('events') Filter::make('events')
->schema([ ->schema([
Select::make('country_id') Select::make('country_id')
->label('Country') ->placeholder('Country')
->hiddenLabel()
->label('')
->searchable() ->searchable()
->preload() ->preload()
->options(function () { ->options(function () {
@@ -111,7 +221,9 @@ class EventsTable
$set('competition_group_id', null); $set('competition_group_id', null);
}), }),
Select::make('competition_group_id') Select::make('competition_group_id')
->label('League') ->placeholder('League')
->hiddenLabel()
->label('')
->multiple() ->multiple()
->columnSpan(2) ->columnSpan(2)
->searchable() ->searchable()
@@ -149,10 +261,10 @@ class EventsTable
->recordActions([ ->recordActions([
ActionGroup::make([ ActionGroup::make([
// EditAction::make(), // EditAction::make(),
// DeleteAction::make(), DeleteAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')),
Action::make('txodds_odds') Action::make('txodds_odds')
->label('TxOdds') ->label('TxOdds')
->disabled(fn () => ! auth()->user()->super_admin) ->disabled(fn () => ! auth()->user()->hasRole('super_admin'))
->icon('heroicon-o-arrow-top-right-on-square') ->icon('heroicon-o-arrow-top-right-on-square')
->url(fn ($record): string => route('txodds_odds', ['sportid' => $record->sport_id, 'txoddsid' => $record->id])) ->url(fn ($record): string => route('txodds_odds', ['sportid' => $record->sport_id, 'txoddsid' => $record->id]))
->openUrlInNewTab(), ->openUrlInNewTab(),
@@ -33,11 +33,6 @@ class GroupFilterResource extends Resource
protected static ?string $pluralModelLabel = 'Groups'; protected static ?string $pluralModelLabel = 'Groups';
public static function canViewAny(): bool
{
return auth()->user()->super_admin == 1;
}
public static function form(Schema $schema): Schema public static function form(Schema $schema): Schema
{ {
return GroupFilterForm::configure($schema); return GroupFilterForm::configure($schema);
@@ -13,9 +13,7 @@ class ListMultilineClients extends ListRecords
protected function getHeaderActions(): array protected function getHeaderActions(): array
{ {
return [ return [
// CreateAction::make() // CreateAction::make()->createAnother(false),
// ->createAnother(false)
// ->hidden(! auth()->user()->super_admin),
]; ];
} }
} }
@@ -27,11 +27,6 @@ class ProviderResource extends Resource
protected static string|UnitEnum|null $navigationGroup = 'Grapper'; 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 public static function form(Schema $schema): Schema
{ {
return ProviderForm::configure($schema); return ProviderForm::configure($schema);
@@ -28,11 +28,6 @@ class SportResource extends Resource
protected static string|\UnitEnum|null $navigationGroup = 'Static Data'; 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 public static function form(Schema $schema): Schema
{ {
return $schema return $schema
@@ -23,11 +23,6 @@ class SupervisorResource extends Resource
protected static string|\UnitEnum|null $navigationGroup = 'Grapper'; 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 public static function form(Schema $schema): Schema
{ {
return SupervisorForm::configure($schema); return SupervisorForm::configure($schema);
@@ -2,7 +2,8 @@
namespace App\Filament\Resources\Users\Schemas; 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\Select;
use Filament\Forms\Components\TextInput; use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
@@ -19,14 +20,22 @@ class UserForm
->label('Email address') ->label('Email address')
->email() ->email()
->required(), ->required(),
// DateTimePicker::make('email_verified_at'),
// TextInput::make('password')
// ->password()
// ->required(),
Select::make('client_id') Select::make('client_id')
->relationship('client', 'name') ->relationship('client', 'name')
->preload(), ->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') Select::make('roles')
->label('Rollen')
->prefixIcon('phosphor-gear')
->aboveContent('Only visible for super_admin')
->visible(fn () => auth()->user()->hasRole('super_admin'))
->relationship('roles', 'name') ->relationship('roles', 'name')
->multiple() ->multiple()
->preload() ->preload()
@@ -20,6 +20,8 @@ class UsersTable
->label('Email address') ->label('Email address')
->searchable(), ->searchable(),
TextColumn::make('client.name')->badge(), TextColumn::make('client.name')->badge(),
TextColumn::make('roles.name')->badge()->color('success')->wrap(),
TextColumn::make('bookmaker.name')->badge()->color('warning'),
TextColumn::make('created_at') TextColumn::make('created_at')
->dateTime() ->dateTime()
->sortable() ->sortable()
@@ -25,11 +25,6 @@ class UserResource extends Resource
protected static string|\UnitEnum|null $navigationGroup = 'User'; 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 public static function form(Schema $schema): Schema
{ {
return UserForm::configure($schema); return UserForm::configure($schema);
+19 -27
View File
@@ -9,46 +9,38 @@ class Column3way extends Column
{ {
protected string $view = 'filament.tables.columns.column_3way'; 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(); return $this;
$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;
} }
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;
} }
} }
+19 -27
View File
@@ -9,46 +9,38 @@ class ColumnDc extends Column
{ {
protected string $view = 'filament.tables.columns.column-dc'; 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(); return $this;
$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;
} }
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;
} }
} }
+19 -27
View File
@@ -9,46 +9,38 @@ class ColumnDnb extends Column
{ {
protected string $view = 'filament.tables.columns.column-dnb'; 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(); return $this;
$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;
} }
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;
} }
} }
+19 -27
View File
@@ -9,46 +9,38 @@ class ColumnGgng extends Column
{ {
protected string $view = 'filament.tables.columns.column-ggng'; 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(); return $this;
$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;
} }
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;
} }
} }
+19 -27
View File
@@ -9,46 +9,38 @@ class ColumnTotal extends Column
{ {
protected string $view = 'filament.tables.columns.column-total'; 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(); return $this;
$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;
} }
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;
} }
} }
+19 -27
View File
@@ -9,46 +9,38 @@ class ColumnTq extends Column
{ {
protected string $view = 'filament.tables.columns.column-tq'; 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(); return $this;
$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;
} }
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;
} }
} }
-55
View File
@@ -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');
}
}
-62
View File
@@ -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');
}
}
+44
View File
@@ -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');
}
}
+44
View File
@@ -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');
}
}
+5 -1
View File
@@ -50,7 +50,11 @@ class TopMenuItems extends Component
public function swop($client_id) 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()'); $this->js('window.location.reload()');
} }
-5
View File
@@ -52,9 +52,4 @@ class Event extends Model
{ {
return $this->hasOne(Element::class, 'id', 'away_id'); 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
View File
@@ -13,11 +13,12 @@ use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable implements FilamentUser, HasAppAuthentication, HasAppAuthenticationRecovery, HasEmailAuthentication, MustVerifyEmail class User extends Authenticatable implements FilamentUser, HasAppAuthentication, HasAppAuthenticationRecovery, HasEmailAuthentication, MustVerifyEmail
{ {
/** @use HasFactory<\Database\Factories\UserFactory> */ /** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable; use HasFactory, HasRoles, Notifiable;
protected $casts = [ protected $casts = [
'bettype_status' => 'json', 'bettype_status' => 'json',
@@ -36,7 +37,9 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
'agb_akzeptiert', 'agb_akzeptiert',
'app_verified_at', 'app_verified_at',
'bettype_status', 'bettype_status',
'client_id',
'sport_id', 'sport_id',
'bookmaker_id',
]; ];
protected static function newFactory(): Factory protected static function newFactory(): Factory
@@ -152,6 +155,11 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
return $this->belongsTo(Client::class); return $this->belongsTo(Client::class);
} }
public function bookmaker()
{
return $this->belongsTo(Bookmaker::class);
}
public function bettype_user() public function bettype_user()
{ {
return $this->hasMany(BettypeUser::class)->where('sport_id', auth()->user()->sport_id); return $this->hasMany(BettypeUser::class)->where('sport_id', auth()->user()->sport_id);
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+70
View File
@@ -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');
}
}
+67
View File
@@ -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; namespace App\Providers\Filament;
use Agencetwogether\HooksHelper\HooksHelperPlugin; use Agencetwogether\HooksHelper\HooksHelperPlugin;
use BezhanSalleh\FilamentShield\FilamentShieldPlugin;
use Awcodes\LightSwitch\Enums\Alignment; use Awcodes\LightSwitch\Enums\Alignment;
use Awcodes\LightSwitch\LightSwitchPlugin; use Awcodes\LightSwitch\LightSwitchPlugin;
use Filament\Actions\Action; use Filament\Actions\Action;
@@ -67,6 +68,7 @@ class AdminPanelProvider extends PanelProvider
// Dashboard::class, // Dashboard::class,
]) ])
->maxContentWidth(Width::ScreenTwoExtraLarge) ->maxContentWidth(Width::ScreenTwoExtraLarge)
// ->maxContentWidth(Width::Full)
->breadcrumbs(false) ->breadcrumbs(false)
->topNavigation() ->topNavigation()
->userMenuItems([ ->userMenuItems([
@@ -94,6 +96,7 @@ class AdminPanelProvider extends PanelProvider
->authMiddleware([ ->authMiddleware([
Authenticate::class, Authenticate::class,
])->plugins([ ])->plugins([
FilamentShieldPlugin::make(),
HooksHelperPlugin::make(), HooksHelperPlugin::make(),
FilamentEditProfilePlugin::make()->shouldRegisterNavigation(false), FilamentEditProfilePlugin::make()->shouldRegisterNavigation(false),
LightSwitchPlugin::make()->position(Alignment::BottomCenter), LightSwitchPlugin::make()->position(Alignment::BottomCenter),
+1
View File
@@ -12,6 +12,7 @@
"php": "^8.3", "php": "^8.3",
"agencetwogether/hookshelper": "^0.0.3", "agencetwogether/hookshelper": "^0.0.3",
"awcodes/light-switch": "^2.0", "awcodes/light-switch": "^2.0",
"bezhansalleh/filament-shield": "^4.0",
"codeat3/blade-phosphor-icons": "^2.0", "codeat3/blade-phosphor-icons": "^2.0",
"codewithdennis/filament-lucide-icons": "*", "codewithdennis/filament-lucide-icons": "*",
"filament/filament": "^4.0", "filament/filament": "^4.0",
Generated
+256 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "c75c2edc61fdc14a9f9af425bf74c8a0", "content-hash": "f7c5bb72f0348ddbd51bf015f82c3feb",
"packages": [ "packages": [
{ {
"name": "agencetwogether/hookshelper", "name": "agencetwogether/hookshelper",
@@ -218,6 +218,178 @@
], ],
"time": "2025-09-18T15:22:43+00:00" "time": "2025-09-18T15:22:43+00:00"
}, },
{
"name": "bezhansalleh/filament-plugin-essentials",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/bezhanSalleh/filament-plugin-essentials.git",
"reference": "c6a9df98b798edbb1857b899169dc8125a59b4e1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bezhanSalleh/filament-plugin-essentials/zipball/c6a9df98b798edbb1857b899169dc8125a59b4e1",
"reference": "c6a9df98b798edbb1857b899169dc8125a59b4e1",
"shasum": ""
},
"require": {
"filament/filament": "^4.0",
"illuminate/contracts": "^11.28|^12.0",
"php": "^8.2",
"spatie/laravel-package-tools": "^1.9"
},
"require-dev": {
"larastan/larastan": "^2.9||^3.0",
"laravel/pint": "^1.14",
"nunomaduro/collision": "^8.1.1||^7.10.0",
"orchestra/testbench": "^10.0.0||^9.0.0",
"pestphp/pest": "^3.0",
"pestphp/pest-plugin-arch": "^3.0",
"pestphp/pest-plugin-laravel": "^3.0",
"pestphp/pest-plugin-type-coverage": "^3.5",
"phpstan/extension-installer": "^1.3||^2.0",
"phpstan/phpstan-deprecation-rules": "^1.1||^2.0",
"phpstan/phpstan-phpunit": "^1.3||^2.0",
"rector/rector": "^2.1",
"spatie/laravel-ray": "^1.40"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"BezhanSalleh\\PluginEssentials\\PluginEssentialsServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"BezhanSalleh\\PluginEssentials\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bezhan Salleh",
"email": "bezhan_salleh@yahoo.com",
"role": "Developer"
}
],
"description": "A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster",
"homepage": "https://github.com/bezhansalleh/filament-plugin-essentials",
"keywords": [
"Bezhan Salleh",
"filament-plugin-essentials",
"laravel"
],
"support": {
"issues": "https://github.com/bezhanSalleh/filament-plugin-essentials/issues",
"source": "https://github.com/bezhanSalleh/filament-plugin-essentials/tree/1.0.1"
},
"funding": [
{
"url": "https://github.com/bezhanSalleh",
"type": "github"
}
],
"time": "2025-11-30T00:09:48+00:00"
},
{
"name": "bezhansalleh/filament-shield",
"version": "4.0.3",
"source": {
"type": "git",
"url": "https://github.com/bezhanSalleh/filament-shield.git",
"reference": "e2d33d8e3c5179d6824d26902056c03ee1c8e7d2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bezhanSalleh/filament-shield/zipball/e2d33d8e3c5179d6824d26902056c03ee1c8e7d2",
"reference": "e2d33d8e3c5179d6824d26902056c03ee1c8e7d2",
"shasum": ""
},
"require": {
"bezhansalleh/filament-plugin-essentials": "^1.0",
"filament/filament": "^4.0",
"illuminate/contracts": "^11.28|^12.0",
"illuminate/support": "*",
"php": "^8.2",
"spatie/laravel-package-tools": "^1.9",
"spatie/laravel-permission": "^6.0"
},
"require-dev": {
"larastan/larastan": "^2.2|^3.0",
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.0|^8.0",
"orchestra/testbench": "^8.0|^9.0|^10.0",
"pestphp/pest": "^2.0|^3.0",
"pestphp/pest-plugin-laravel": "^2.0|^3.0",
"pestphp/pest-plugin-livewire": "^3.0",
"pestphp/pest-plugin-type-coverage": "^3.5",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^10.1|^11.0",
"rector/rector": "^2.1",
"spatie/laravel-ray": "^1.40"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"FilamentShield": "BezhanSalleh\\FilamentShield\\Facades\\FilamentShield"
},
"providers": [
"BezhanSalleh\\FilamentShield\\FilamentShieldServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"BezhanSalleh\\FilamentShield\\": "src",
"BezhanSalleh\\FilamentShield\\Database\\Factories\\": "database/factories"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bezhan Salleh",
"email": "bezhan_salleh@yahoo.com",
"role": "Developer"
}
],
"description": "Filament support for `spatie/laravel-permission`.",
"homepage": "https://github.com/bezhansalleh/filament-shield",
"keywords": [
"acl",
"bezhanSalleh",
"filament",
"filament-shield",
"laravel",
"permission",
"permissions",
"rbac",
"roles",
"security"
],
"support": {
"issues": "https://github.com/bezhanSalleh/filament-shield/issues",
"source": "https://github.com/bezhanSalleh/filament-shield/tree/4.0.3"
},
"funding": [
{
"url": "https://github.com/bezhanSalleh",
"type": "github"
}
],
"time": "2025-11-29T20:33:45+00:00"
},
{ {
"name": "blade-ui-kit/blade-heroicons", "name": "blade-ui-kit/blade-heroicons",
"version": "2.6.0", "version": "2.6.0",
@@ -5892,6 +6064,89 @@
], ],
"time": "2025-07-17T15:46:43+00:00" "time": "2025-07-17T15:46:43+00:00"
}, },
{
"name": "spatie/laravel-permission",
"version": "6.24.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-permission.git",
"reference": "76adb1fc8d07c16a0721c35c4cc330b7a12598d7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-permission/zipball/76adb1fc8d07c16a0721c35c4cc330b7a12598d7",
"reference": "76adb1fc8d07c16a0721c35c4cc330b7a12598d7",
"shasum": ""
},
"require": {
"illuminate/auth": "^8.12|^9.0|^10.0|^11.0|^12.0",
"illuminate/container": "^8.12|^9.0|^10.0|^11.0|^12.0",
"illuminate/contracts": "^8.12|^9.0|^10.0|^11.0|^12.0",
"illuminate/database": "^8.12|^9.0|^10.0|^11.0|^12.0",
"php": "^8.0"
},
"require-dev": {
"laravel/passport": "^11.0|^12.0",
"laravel/pint": "^1.0",
"orchestra/testbench": "^6.23|^7.0|^8.0|^9.0|^10.0",
"phpunit/phpunit": "^9.4|^10.1|^11.5"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Spatie\\Permission\\PermissionServiceProvider"
]
},
"branch-alias": {
"dev-main": "6.x-dev",
"dev-master": "6.x-dev"
}
},
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Spatie\\Permission\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Freek Van der Herten",
"email": "freek@spatie.be",
"homepage": "https://spatie.be",
"role": "Developer"
}
],
"description": "Permission handling for Laravel 8.0 and up",
"homepage": "https://github.com/spatie/laravel-permission",
"keywords": [
"acl",
"laravel",
"permission",
"permissions",
"rbac",
"roles",
"security",
"spatie"
],
"support": {
"issues": "https://github.com/spatie/laravel-permission/issues",
"source": "https://github.com/spatie/laravel-permission/tree/6.24.0"
},
"funding": [
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2025-12-13T21:45:21+00:00"
},
{ {
"name": "spatie/shiki-php", "name": "spatie/shiki-php",
"version": "2.3.2", "version": "2.3.2",
+263
View File
@@ -0,0 +1,263 @@
<?php
declare(strict_types=1);
return [
/*
|--------------------------------------------------------------------------
| Shield Resource
|--------------------------------------------------------------------------
|
| Here you may configure the built-in role management resource. You can
| customize the URL, choose whether to show model paths, group it under
| a cluster, and decide which permission tabs to display.
|
*/
'shield_resource' => [
'slug' => 'shield/roles',
'show_model_path' => true,
'cluster' => null,
'tabs' => [
'pages' => true,
'widgets' => true,
'resources' => true,
'custom_permissions' => false,
],
],
/*
|--------------------------------------------------------------------------
| Multi-Tenancy
|--------------------------------------------------------------------------
|
| When your application supports teams, Shield will automatically detect
| and configure the tenant model during setup. This enables tenant-scoped
| roles and permissions throughout your application.
|
*/
'tenant_model' => null,
/*
|--------------------------------------------------------------------------
| User Model
|--------------------------------------------------------------------------
|
| This value contains the class name of your user model. This model will
| be used for role assignments and must implement the HasRoles trait
| provided by the Spatie\Permission package.
|
*/
'auth_provider_model' => 'App\\Models\\User',
/*
|--------------------------------------------------------------------------
| Super Admin
|--------------------------------------------------------------------------
|
| Here you may define a super admin that has unrestricted access to your
| application. You can choose to implement this via Laravel's gate system
| or as a traditional role with all permissions explicitly assigned.
|
*/
'super_admin' => [
'enabled' => true,
'name' => 'super_admin',
'define_via_gate' => false,
'intercept_gate' => 'before',
],
/*
|--------------------------------------------------------------------------
| Panel User
|--------------------------------------------------------------------------
|
| When enabled, Shield will create a basic panel user role that can be
| assigned to users who should have access to your Filament panels but
| don't need any specific permissions beyond basic authentication.
|
*/
'panel_user' => [
'enabled' => true,
'name' => 'panel_user',
],
/*
|--------------------------------------------------------------------------
| Permission Builder
|--------------------------------------------------------------------------
|
| You can customize how permission keys are generated to match your
| preferred naming convention and organizational standards. Shield uses
| these settings when creating permission names from your resources.
|
| Supported formats: snake, kebab, pascal, camel, upper_snake, lower_snake
|
*/
'permissions' => [
'separator' => ':',
'case' => 'pascal',
'generate' => true,
],
/*
|--------------------------------------------------------------------------
| Policies
|--------------------------------------------------------------------------
|
| Shield can automatically generate Laravel policies for your resources.
| When merge is enabled, the methods below will be combined with any
| resource-specific methods you define in the resources section.
|
*/
'policies' => [
'path' => app_path('Policies'),
'merge' => true,
'generate' => true,
'methods' => [
'viewAny', 'view', 'create', 'update', 'delete', 'restore',
'forceDelete', 'forceDeleteAny', 'restoreAny', 'replicate', 'reorder',
],
'single_parameter_methods' => [
'viewAny',
'create',
'deleteAny',
'forceDeleteAny',
'restoreAny',
'reorder',
],
],
/*
|--------------------------------------------------------------------------
| Localization
|--------------------------------------------------------------------------
|
| Shield supports multiple languages out of the box. When enabled, you
| can provide translated labels for permissions to create a more
| localized experience for your international users.
|
*/
'localization' => [
'enabled' => false,
'key' => 'filament-shield::filament-shield.resource_permission_prefixes_labels',
],
/*
|--------------------------------------------------------------------------
| Resources
|--------------------------------------------------------------------------
|
| Here you can fine-tune permissions for specific Filament resources.
| Use the 'manage' array to override the default policy methods for
| individual resources, giving you granular control over permissions.
|
*/
'resources' => [
'subject' => 'model',
'manage' => [
\BezhanSalleh\FilamentShield\Resources\Roles\RoleResource::class => [
'viewAny',
'view',
'create',
'update',
'delete',
],
],
'exclude' => [
//
],
],
/*
|--------------------------------------------------------------------------
| Pages
|--------------------------------------------------------------------------
|
| Most Filament pages only require view permissions. Pages listed in the
| exclude array will be skipped during permission generation and won't
| appear in your role management interface.
|
*/
'pages' => [
'subject' => 'class',
'prefix' => 'view',
'exclude' => [
\Filament\Pages\Dashboard::class,
],
],
/*
|--------------------------------------------------------------------------
| Widgets
|--------------------------------------------------------------------------
|
| Like pages, widgets typically only need view permissions. Add widgets
| to the exclude array if you don't want them to appear in your role
| management interface.
|
*/
'widgets' => [
'subject' => 'class',
'prefix' => 'view',
'exclude' => [
\Filament\Widgets\AccountWidget::class,
\Filament\Widgets\FilamentInfoWidget::class,
],
],
/*
|--------------------------------------------------------------------------
| Custom Permissions
|--------------------------------------------------------------------------
|
| Sometimes you need permissions that don't map to resources, pages, or
| widgets. Define any custom permissions here and they'll be available
| when editing roles in your application.
|
*/
'custom_permissions' => [],
/*
|--------------------------------------------------------------------------
| Entity Discovery
|--------------------------------------------------------------------------
|
| By default, Shield only looks for entities in your default Filament
| panel. Enable these options if you're using multiple panels and want
| Shield to discover entities across all of them.
|
*/
'discovery' => [
'discover_all_resources' => false,
'discover_all_widgets' => false,
'discover_all_pages' => false,
],
/*
|--------------------------------------------------------------------------
| Role Policy
|--------------------------------------------------------------------------
|
| Shield can automatically register a policy for role management itself.
| This lets you control who can manage roles using Laravel's built-in
| authorization system. Requires a RolePolicy class in your app.
|
*/
'register_role_policy' => true,
];
@@ -19,9 +19,8 @@ return new class extends Migration
$table->string('password'); $table->string('password');
$table->integer('client_id'); $table->integer('client_id');
$table->integer('sport_id')->default(1); $table->integer('sport_id')->default(1);
$table->integer('multiline_setting_id')->nullable(); $table->integer('bookmaker_id')->nullable();
$table->json('bettype_status')->nullable(); $table->json('bettype_status')->nullable();
$table->boolean('super_admin')->default(false);
$table->text('app_authentication_secret')->nullable(); $table->text('app_authentication_secret')->nullable();
$table->text('app_authentication_recovery_codes')->nullable(); $table->text('app_authentication_recovery_codes')->nullable();
@@ -0,0 +1,134 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$teams = config('permission.teams');
$tableNames = config('permission.table_names');
$columnNames = config('permission.column_names');
$pivotRole = $columnNames['role_pivot_key'] ?? 'role_id';
$pivotPermission = $columnNames['permission_pivot_key'] ?? 'permission_id';
throw_if(empty($tableNames), Exception::class, 'Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.');
throw_if($teams && empty($columnNames['team_foreign_key'] ?? null), Exception::class, 'Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.');
Schema::create($tableNames['permissions'], static function (Blueprint $table) {
// $table->engine('InnoDB');
$table->bigIncrements('id'); // permission id
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
$table->timestamps();
$table->unique(['name', 'guard_name']);
});
Schema::create($tableNames['roles'], static function (Blueprint $table) use ($teams, $columnNames) {
// $table->engine('InnoDB');
$table->bigIncrements('id'); // role id
if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
$table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
$table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index');
}
$table->string('name'); // For MyISAM use string('name', 225); // (or 166 for InnoDB with Redundant/Compact row format)
$table->string('guard_name'); // For MyISAM use string('guard_name', 25);
$table->timestamps();
if ($teams || config('permission.testing')) {
$table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
} else {
$table->unique(['name', 'guard_name']);
}
});
Schema::create($tableNames['model_has_permissions'], static function (Blueprint $table) use ($tableNames, $columnNames, $pivotPermission, $teams) {
$table->unsignedBigInteger($pivotPermission);
$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index');
$table->foreign($pivotPermission)
->references('id') // permission id
->on($tableNames['permissions'])
->onDelete('cascade');
if ($teams) {
$table->unsignedBigInteger($columnNames['team_foreign_key']);
$table->index($columnNames['team_foreign_key'], 'model_has_permissions_team_foreign_key_index');
$table->primary([$columnNames['team_foreign_key'], $pivotPermission, $columnNames['model_morph_key'], 'model_type'],
'model_has_permissions_permission_model_type_primary');
} else {
$table->primary([$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
'model_has_permissions_permission_model_type_primary');
}
});
Schema::create($tableNames['model_has_roles'], static function (Blueprint $table) use ($tableNames, $columnNames, $pivotRole, $teams) {
$table->unsignedBigInteger($pivotRole);
$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index');
$table->foreign($pivotRole)
->references('id') // role id
->on($tableNames['roles'])
->onDelete('cascade');
if ($teams) {
$table->unsignedBigInteger($columnNames['team_foreign_key']);
$table->index($columnNames['team_foreign_key'], 'model_has_roles_team_foreign_key_index');
$table->primary([$columnNames['team_foreign_key'], $pivotRole, $columnNames['model_morph_key'], 'model_type'],
'model_has_roles_role_model_type_primary');
} else {
$table->primary([$pivotRole, $columnNames['model_morph_key'], 'model_type'],
'model_has_roles_role_model_type_primary');
}
});
Schema::create($tableNames['role_has_permissions'], static function (Blueprint $table) use ($tableNames, $pivotRole, $pivotPermission) {
$table->unsignedBigInteger($pivotPermission);
$table->unsignedBigInteger($pivotRole);
$table->foreign($pivotPermission)
->references('id') // permission id
->on($tableNames['permissions'])
->onDelete('cascade');
$table->foreign($pivotRole)
->references('id') // role id
->on($tableNames['roles'])
->onDelete('cascade');
$table->primary([$pivotPermission, $pivotRole], 'role_has_permissions_permission_id_role_id_primary');
});
app('cache')
->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null)
->forget(config('permission.cache.key'));
}
/**
* Reverse the migrations.
*/
public function down(): void
{
$tableNames = config('permission.table_names');
throw_if(empty($tableNames), Exception::class, 'Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.');
Schema::drop($tableNames['role_has_permissions']);
Schema::drop($tableNames['model_has_roles']);
Schema::drop($tableNames['model_has_permissions']);
Schema::drop($tableNames['roles']);
Schema::drop($tableNames['permissions']);
}
};
+1 -1
View File
@@ -12,7 +12,7 @@ class DatabaseSeeder extends Seeder
public function run(): void public function run(): void
{ {
$this->call([ $this->call([
UserSeeder::class, RolesAndPermissionsSeeder::class,
ProvoiderSeeder::class, ProvoiderSeeder::class,
ClientsSeeder::class, ClientsSeeder::class,
BookmakerSeeder::class, BookmakerSeeder::class,
@@ -0,0 +1,48 @@
<?php
namespace Database\Seeders;
use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
class RolesAndPermissionsSeeder extends Seeder
{
public function run(): void
{
DB::table('roles')->upsert(
[
['name' => 'super_admin', 'guard_name' => 'web'],
['name' => 'konto_switch', 'guard_name' => 'web'],
['name' => 'betsapi_mapper', 'guard_name' => 'web'],
],
['name']
);
$user = User::factory()->create([
'name' => 'Hermann Telser',
'email' => 'ht@webwerkstatt.tirol',
'password' => Hash::make('salam'),
'email_verified_at' => now(),
'client_id' => 1,
'sport_id' => 1,
'bookmaker_id' => 26,
]);
$user->assignRole('super_admin');
$user->assignRole('konto_switch');
$user->assignRole('betsapi_mapper');
$user = User::factory()->create([
'name' => 'Ubaldo Perrucci',
'email' => 'ubaldo.perrucci@gmail.com',
'password' => Hash::make('oscar'),
'email_verified_at' => now(),
'client_id' => 1,
'sport_id' => 1,
'bookmaker_id' => 26,
]);
$user->assignRole('super_admin');
$user->assignRole('konto_switch');
$user->assignRole('betsapi_mapper');
}
}
-36
View File
@@ -1,36 +0,0 @@
<?php
namespace Database\Seeders;
use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
class UserSeeder extends Seeder
{
public function run(): void
{
User::factory()->create([
'name' => 'Hermann Telser',
'email' => 'ht@webwerkstatt.tirol',
'password' => Hash::make('salam'),
'email_verified_at' => now(),
'client_id' => 1,
'sport_id' => 1,
'multiline_setting_id' => 1,
'super_admin' => 1,
]);
User::factory()->create([
'name' => 'Ubaldo Perrucci',
'email' => 'ubaldo.perrucci@gmail.com',
'password' => Hash::make('oscar'),
'email_verified_at' => now(),
'client_id' => 1,
'sport_id' => 1,
'multiline_setting_id' => 1,
'super_admin' => 1,
]);
}
}
-2076
View File
File diff suppressed because it is too large. Load diff
-3
View File
@@ -1,3 +0,0 @@
/* Tabulator v6.3.1 (c) Oliver Folkerd 2025 */
class e{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class t{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s,o=e?t.split(e):[t],n=o.length;for(let e=0;e<n&&(s=i=i[o[e]],i);e++);return s}static deepClone(e,t,i=[]){var s={}.__proto__,o=[].__proto__;for(var n in t||(t=Object.assign(Array.isArray(e)?[]:{},e)),e){let r,a,l=e[n];null==l||"object"!=typeof l||l.__proto__!==s&&l.__proto__!==o||(r=i.findIndex((e=>e.subject===l)),r>-1?t[n]=i[r].copy:(a=Object.assign(Array.isArray(l)?[]:{},l),i.unshift({subject:l,copy:a}),t[n]=this.deepClone(l,a,i)))}return t}}let i=class i extends e{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return"string"==typeof e?(e=document.querySelector(e))||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)"):!0===e&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var i=!(e instanceof MouseEvent),s=i?e.touches[0].pageX:e.pageX,o=i?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let e=t.elOffset(this.container);s-=e.left,o-=e.top}return{x:s,y:o}}elementPositionCoords(e,i="right"){var s,o,n,r=t.elOffset(e);switch(this.container!==document.body&&(s=t.elOffset(this.container),r.left-=s.left,r.top-=s.top),i){case"right":o=r.left+e.offsetWidth,n=r.top-1;break;case"bottom":o=r.left,n=r.top+e.offsetHeight;break;case"left":o=r.left,n=r.top-1;break;case"top":o=r.left,n=r.top;break;case"center":o=r.left+e.offsetWidth/2,n=r.top+e.offsetHeight/2}return{x:o,y:n,offset:r}}show(e,t){var i,s,o,n,r;return this.destroyed||this.table.destroyed||(e instanceof HTMLElement?(o=e,n=(r=this.elementPositionCoords(e,t)).offset,i=r.x,s=r.y):"number"==typeof e?(n={top:0,left:0},i=e,s=t):(i=(r=this.containerEventCoords(e)).x,s=r.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,s,o,n,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",(e=>{e.stopPropagation()}))),this}_fitToScreen(e,t,i,s,o){var n=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.ofLine truncated
//# sourceMappingURL=tabulator_esm.min.mjs.map
+5 -4
View File
@@ -1,8 +1,8 @@
@import '../../../../vendor/filament/filament/resources/css/theme.css'; @import '../../../../vendor/filament/filament/resources/css/theme.css';
@source '../../../../app/Filament/**/*'; @source '../../../../app/Filament/**/*';
@source '../../../../resources/views/livewire/*';
@source '../../../../resources/views/filament/**/*'; @source '../../../../resources/views/filament/**/*';
@source '../../../../resources/views/filament/pages/**/*';
@source '../../../../vendor/awcodes/light-switch/resources/**/*.blade.php'; @source '../../../../vendor/awcodes/light-switch/resources/**/*.blade.php';
/* hide reset link in filters */ /* hide reset link in filters */
@@ -13,14 +13,15 @@ button[wire\:click="resetTableFiltersForm"] {
/* .fi-ta-header-toolbar { /* .fi-ta-header-toolbar {
@apply flex-row-reverse; @apply flex-row-reverse;
} } */
*/
/* searchbox left */ /* searchbox move to left */
.fi-ta-header-toolbar>*:nth-child(2) { .fi-ta-header-toolbar>*:nth-child(2) {
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
} }
/* label bettypes centered */
.fi-ta-header-cell-oddstotal, .fi-ta-header-cell-oddstotal,
.fi-ta-header-cell-oddstq, .fi-ta-header-cell-oddstq,
.fi-ta-header-cell-oddsggng, .fi-ta-header-cell-oddsggng,
@@ -1,25 +1,44 @@
@php @php
$loadData($record, $record->multiline_client); $loadData($record);
@endphp @endphp
@include('filament.tables.columns.multiline.fumetto_dc') @if ($hasData())
<div {{ $getExtraAttributeBag() }} class="max-w-80 grid grid-cols-5 grid-rows-4 text-xs gap-0 justify-between text-right" @include('filament.tables.columns.fumetto.fumetto_dc')
style="width: 225px;">
<div {{ $getExtraAttributeBag() }} class="grid grid-cols-5" style="width: 225px;">
@foreach ($getData() as $item) @include('filament.tables.columns.multiline.label', ['labels' => ['1X', '12', 'X2']])
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->dc1x, 'decimal' => 2]) @foreach ($getBookmaker() as $bookmaker_id)
@foreach ($getData() as $item)
@if ($item->bookmaker_id == $bookmaker_id)
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->dc12, 'decimal' => 2]) @include('filament.tables.columns.multiline.odds', [
'odd' => $item->dc1x,
'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->dcx2, 'decimal' => 2]) @include('filament.tables.columns.multiline.odds', [
'odd' => $item->dc12,
'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->margin, 'decimal' => 1]) @include('filament.tables.columns.multiline.odds', [
@endforeach 'odd' => $item->dcx2,
</div> 'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->margin,
'decimal' => 1,
])
@endif
@endforeach
@endforeach
</div>
@endif
@@ -1,23 +1,39 @@
@php @php
$loadData($record, $record->multiline_client); $loadData($record);
@endphp @endphp
@include('filament.tables.columns.multiline.fumetto_dnb') @if ($hasData())
<div {{ $getExtraAttributeBag() }} class="max-w-80 grid grid-cols-4 grid-rows-4 text-xs gap-0 justify-between text-right" @include('filament.tables.columns.fumetto.fumetto_dnb')
style="width: 190px;">
<div {{ $getExtraAttributeBag() }} class="grid grid-cols-4" style="width: 190px;">
@foreach ($getData() as $item) @include('filament.tables.columns.multiline.label', ['labels' => ['DNB1', 'DNB2']])
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->dnb1, 'decimal' => 2]) @foreach ($getBookmaker() as $bookmaker_id)
@foreach ($getData() as $item)
@if ($item->bookmaker_id == $bookmaker_id)
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->dnb2, 'decimal' => 2]) @include('filament.tables.columns.multiline.odds', [
'odd' => $item->dnb1,
'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->margin, 'decimal' => 1]) @include('filament.tables.columns.multiline.odds', [
@endforeach 'odd' => $item->dnb2,
</div> 'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->margin,
'decimal' => 1,
])
@endif
@endforeach
@endforeach
</div>
@endif
@@ -1,23 +1,39 @@
@php @php
$loadData($record, $record->multiline_client); $loadData($record);
@endphp @endphp
@include('filament.tables.columns.multiline.fumetto_ggng') @if ($hasData())
<div {{ $getExtraAttributeBag() }} class="max-w-80 grid grid-cols-4 grid-rows-4 text-xs gap-0 justify-between text-right" @include('filament.tables.columns.fumetto.fumetto_ggng')
style="width: 190px;">
<div {{ $getExtraAttributeBag() }} class="grid grid-cols-4" style="width: 190px;">
@foreach ($getData() as $item) @include('filament.tables.columns.multiline.label', ['labels' => ['GG', 'NG']])
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->gg, 'decimal' => 2]) @foreach ($getBookmaker() as $bookmaker_id)
@foreach ($getData() as $item)
@if ($item->bookmaker_id == $bookmaker_id)
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->ng, 'decimal' => 2]) @include('filament.tables.columns.multiline.odds', [
'odd' => $item->gg,
'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->margin, 'decimal' => 1]) @include('filament.tables.columns.multiline.odds', [
@endforeach 'odd' => $item->ng,
</div> 'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->margin,
'decimal' => 1,
])
@endif
@endforeach
@endforeach
</div>
@endif
@@ -1,25 +1,44 @@
@php @php
$loadData($record, $record->multiline_client); $loadData($record);
@endphp @endphp
@include('filament.tables.columns.multiline.fumetto_total') @if ($hasData())
<div {{ $getExtraAttributeBag() }} class="max-w-80 grid grid-cols-5 grid-rows-4 text-xs gap-0 justify-between text-right" @include('filament.tables.columns.fumetto.fumetto_total')
style="width: 225px;">
<div {{ $getExtraAttributeBag() }} class="grid grid-cols-5" style="width: 225px;">
@foreach ($getData() as $item) @include('filament.tables.columns.multiline.label', ['labels' => ['O', 'U', 'T']])
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->over, 'decimal' => 2]) @foreach ($getBookmaker() as $bookmaker_id)
@foreach ($getData() as $item)
@if ($item->bookmaker_id == $bookmaker_id)
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->under, 'decimal' => 2]) @include('filament.tables.columns.multiline.odds', [
'odd' => $item->over,
'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->total, 'decimal' => 1]) @include('filament.tables.columns.multiline.odds', [
'odd' => $item->under,
'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->margin, 'decimal' => 1]) @include('filament.tables.columns.multiline.odds', [
@endforeach 'odd' => $item->total,
</div> 'decimal' => 1,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->margin,
'decimal' => 1,
])
@endif
@endforeach
@endforeach
</div>
@endif
@@ -1,23 +1,39 @@
@php @php
$loadData($record, $record->multiline_client); $loadData($record);
@endphp @endphp
@include('filament.tables.columns.multiline.fumetto_tq') @if ($hasData())
<div {{ $getExtraAttributeBag() }} class="max-w-80 grid grid-cols-4 grid-rows-4 text-xs gap-0 justify-between text-right" @include('filament.tables.columns.fumetto.fumetto_tq')
style="width: 190px;">
<div {{ $getExtraAttributeBag() }} class="grid grid-cols-4" style="width: 190px;">
@foreach ($getData() as $item) @include('filament.tables.columns.multiline.label', ['labels' => ['H', 'A']])
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->htq, 'decimal' => 2]) @foreach ($getBookmaker() as $bookmaker_id)
@foreach ($getData() as $item)
@if ($item->bookmaker_id == $bookmaker_id)
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->atq, 'decimal' => 2]) @include('filament.tables.columns.multiline.odds', [
'odd' => $item->htq,
'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->margin, 'decimal' => 1]) @include('filament.tables.columns.multiline.odds', [
@endforeach 'odd' => $item->atq,
</div> 'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->margin,
'decimal' => 1,
])
@endif
@endforeach
@endforeach
</div>
@endif
@@ -1,31 +1,44 @@
@php @php
$loadData($record, $record->multiline_client); $loadData($record);
@endphp @endphp
@include('filament.tables.columns.multiline.fumetto_1x2') @if ($hasData())
<div {{ $getExtraAttributeBag() }} @include('filament.tables.columns.fumetto.fumetto_1x2')
class="max-w-80 grid grid-cols-5 grid-rows-4 text-xs gap-0 justify-between text-right text-gray-700 dark:text-gray-400"
style="width: 225px;">
{{-- <div></div> <div {{ $getExtraAttributeBag() }} class="grid grid-cols-5" style="width: 225px;">
<div class="text-center">1</div>
<div class="text-center">X</div>
<div class="text-center">2</div>
<div class="text-center">M</div> --}}
@foreach ($getData() as $item) @include('filament.tables.columns.multiline.label', ['labels' => ['1', 'X', '2']])
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->h3w, 'decimal' => 2]) @foreach ($getBookmaker() as $bookmaker_id)
@foreach ($getData() as $item)
@if ($item->bookmaker_id == $bookmaker_id)
@include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '',
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->d3w, 'decimal' => 2]) @include('filament.tables.columns.multiline.odds', [
'odd' => $item->h3w,
'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->a3w, 'decimal' => 2]) @include('filament.tables.columns.multiline.odds', [
'odd' => $item->d3w,
'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->margin, 'decimal' => 1]) @include('filament.tables.columns.multiline.odds', [
@endforeach 'odd' => $item->a3w,
</div> 'decimal' => 2,
])
@include('filament.tables.columns.multiline.odds', [
'odd' => $item->margin,
'decimal' => 1,
])
@endif
@endforeach
@endforeach
</div>
@endif
@@ -1,9 +1,9 @@
@if ($hasodds()) @if ($hasData())
<div x-data="{ message: 'loading..' }" class="mx-3 my-auto"> <div x-data="{ message: 'loading..' }" class="mx-3 my-auto">
<template x-ref="template"> <template x-ref="template">
<div class="grid grid-cols-5 grid-rows-5 gap-1 m-5"> <div class="grid grid-cols-5 grid-rows-5 gap-1 m-5">
@foreach ($getFumetto() as $item) @foreach ($getData() as $item)
@include('filament.tables.columns.multiline.bkm', [ @include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id, 'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '', 'icon' => $item->bookmaker->icon ?? '',
@@ -1,9 +1,9 @@
@if ($hasodds()) @if ($hasData())
<div x-data="{ message: 'loading..' }" class="mx-3 my-auto"> <div x-data="{ message: 'loading..' }" class="mx-3 my-auto">
<template x-ref="template"> <template x-ref="template">
<div class="grid grid-cols-5 grid-rows-5 gap-1 m-5"> <div class="grid grid-cols-5 grid-rows-5 gap-1 m-5">
@foreach ($getFumetto() as $item) @foreach ($getData() as $item)
@include('filament.tables.columns.multiline.bkm', [ @include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id, 'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '', 'icon' => $item->bookmaker->icon ?? '',
@@ -1,9 +1,9 @@
@if ($hasodds()) @if ($hasData())
<div x-data="{ message: 'loading..' }" class="mx-3 my-auto"> <div x-data="{ message: 'loading..' }" class="mx-3 my-auto">
<template x-ref="template"> <template x-ref="template">
<div class="grid grid-cols-4 grid-rows-5 gap-1 m-5"> <div class="grid grid-cols-4 grid-rows-5 gap-1 m-5">
@foreach ($getFumetto() as $item) @foreach ($getData() as $item)
@include('filament.tables.columns.multiline.bkm', [ @include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id, 'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '', 'icon' => $item->bookmaker->icon ?? '',
@@ -1,9 +1,9 @@
@if ($hasodds()) @if ($hasData())
<div x-data="{ message: 'loading..' }" class="mx-3 my-auto"> <div x-data="{ message: 'loading..' }" class="mx-3 my-auto">
<template x-ref="template"> <template x-ref="template">
<div class="grid grid-cols-4 grid-rows-5 gap-1 m-5"> <div class="grid grid-cols-4 grid-rows-5 gap-1 m-5">
@foreach ($getFumetto() as $item) @foreach ($getData() as $item)
@include('filament.tables.columns.multiline.bkm', [ @include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id, 'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '', 'icon' => $item->bookmaker->icon ?? '',
@@ -1,9 +1,9 @@
@if ($hasodds()) @if ($hasData())
<div x-data="{ message: 'loading..' }" class="mx-3 my-auto"> <div x-data="{ message: 'loading..' }" class="mx-3 my-auto">
<template x-ref="template"> <template x-ref="template">
<div class="grid grid-cols-5 grid-rows-5 gap-1 m-5"> <div class="grid grid-cols-5 grid-rows-5 gap-1 m-5">
@foreach ($getFumetto() as $item) @foreach ($getData() as $item)
@include('filament.tables.columns.multiline.bkm', [ @include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id, 'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '', 'icon' => $item->bookmaker->icon ?? '',
@@ -1,9 +1,9 @@
@if ($hasodds()) @if ($hasData())
<div x-data="{ message: 'loading..' }" class="mx-3 my-auto"> <div x-data="{ message: 'loading..' }" class="mx-3 my-auto">
<template x-ref="template"> <template x-ref="template">
<div class="grid grid-cols-4 grid-rows-5 gap-1 m-5"> <div class="grid grid-cols-4 grid-rows-5 gap-1 m-5">
@foreach ($getFumetto() as $item) @foreach ($getData() as $item)
@include('filament.tables.columns.multiline.bkm', [ @include('filament.tables.columns.multiline.bkm', [
'bookmaker_id' => $item->bookmaker_id, 'bookmaker_id' => $item->bookmaker_id,
'icon' => $item->bookmaker->icon ?? '', 'icon' => $item->bookmaker->icon ?? '',
@@ -0,0 +1,6 @@
<div></div>
@foreach ($labels as $label)
<div class="text-primary-700 dark:text-primary-500" style="font-size: 10px; text-align:center;">
{{ $label }}</div>
@endforeach
<div class="text-primary-600 dark:text-primary-500" style="font-size: 10px; text-align:center;">M</div>
@@ -1,65 +0,0 @@
@switch($menu)
@case('1x2')
<div class="grid grid-cols-6 justify-items-stretch text-center text-xs">
<div></div>
<div></div>
<div>1</div>
<div>X</div>
<div>2</div>
<div>M</div>
</div>
@break
@case('hc')
@case('tq')
<div class="grid grid-cols-5 justify-items-stretch text-center text-xs">
<div></div>
<div></div>
<div>H</div>
<div>A</div>
<div>M</div>
</div>
@break
@case('dc')
<div class="grid grid-cols-6 justify-items-stretch text-center text-xs">
<div></div>
<div></div>
<div>1X</div>
<div>12</div>
<div>X2</div>
<div>M</div>
</div>
@break
@case('dnb')
<div class="grid grid-cols-5 justify-items-stretch text-center text-xs">
<div></div>
<div></div>
<div>D1</div>
<div>D2</div>
<div>M</div>
</div>
@break
@case('gg')
<div class="grid grid-cols-5 justify-items-stretch text-center text-xs">
<div></div>
<div></div>
<div>GG</div>
<div>NG</div>
<div>M</div>
</div>
@break
@case('ou')
<div class="grid grid-cols-6 justify-items-stretch text-center text-xs">
<div></div>
<div></div>
<div>O</div>
<div>U</div>
<div>T</div>
<div>M</div>
</div>
@break
@endswitch
@@ -1,27 +0,0 @@
@php
$loadSlots($getState(), $record->multiline_client);
@endphp
@if ($has3Columns())
<div {{ $getExtraAttributeBag() }} class="grid grid-cols-5 grid-rows-4 text-xs">
@else
<div {{ $getExtraAttributeBag() }} class="grid grid-cols-4 grid-rows-4 text-xs">
@endif
@foreach ($getSlots() as $item)
@include('filament.tables.columns.multiline.bkm', [
'icon' => $item?->bookmaker->icon,
'bookmaker_id' => $item->bookmaker_id,
])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->a, 'decimal' => 2])
@if ($has3Columns())
@include('filament.tables.columns.multiline.odds', ['odd' => $item->b, 'decimal' => 2])
@endif
@include('filament.tables.columns.multiline.odds', ['odd' => $item->c, 'decimal' => 2])
@include('filament.tables.columns.multiline.odds', ['odd' => $item->margin, 'decimal' => 1])
@endforeach
</div>
@@ -1,4 +1,4 @@
<div class="text-gray-700 dark:text-gray-400 h-4 mb-0.5 ml-0.5 border border-transparent"> <div class="mb-0.5 ml-0.5 border border-transparent" style="font-size: 10.5px; text-align:center;">
&nbsp; &nbsp;
@if (isset($odd)) @if (isset($odd))
{{ number_format($odd, $decimal) }} {{ number_format($odd, $decimal) }}
@@ -1,5 +0,0 @@
<div class="grid grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 w-80 md:w-160 xl:w240 m-0">
@foreach ($getComponents() as $layoutComponent)
{{ $layoutComponent->record($getRecord())->recordKey($getRecordKey())->rowLoop($getRowLoop())->renderInLayout() }}
@endforeach
</div>
@@ -1,8 +0,0 @@
<div class="grid grid-cols-2 gap-4">
<div>
{{ $leftContent }}
</div>
<div>
{{ $rightContent }}
</div>
</div>
@@ -1,6 +1,7 @@
<div class="flex gap-4 justify-end"> <div className="flex flex-1">
@foreach ($multilines as $multiline) @foreach ($multilines as $multiline)
<x-filament::button size="xs" tooltip="{{ $multiline['name'] }}" wire:click="toggleBettype({{ $multiline['id'] }})" <x-filament::button size="xs" class="mx-1" tooltip="{{ $multiline['name'] }}"
wire:dispatch="refreshTable" :color="!$multiline['is_active'] ? 'gray' : 'primary'"> {{ $multiline['short'] }} </x-filament::button> wire:click="toggleBettype({{ $multiline['id'] }})" wire:dispatch="refreshTable" :color="!$multiline['is_active'] ? 'gray' : 'primary'">
{{ $multiline['short'] }} </x-filament::button>
@endforeach @endforeach
</div> </div>
@@ -1,8 +1,8 @@
<div class="flex flex-1 gap-4"> <div class="flex flex-1">
@if ($this->current == 'filament.admin.resources.events.index') @if ($this->current == 'filament.admin.resources.events.index')
<x-filament::input.wrapper prefix-icon="{{ $sporticon }}" prefix-icon-color="primary"> <x-filament::input.wrapper prefix-icon="{{ $sporticon }}" prefix-icon-color="primary" class="mx-4">
<x-filament::input.select wire:model="sport_id" wire:change="swopSport"> <x-filament::input.select wire:model="sport_id" wire:change="swopSport">
@foreach ($sports as $id => $name) @foreach ($sports as $id => $name)
<option value="{{ $id }}">{{ $name }}</option> <option value="{{ $id }}">{{ $name }}</option>
@@ -10,7 +10,7 @@
</x-filament::input.select> </x-filament::input.select>
</x-filament::input.wrapper> </x-filament::input.wrapper>
<x-filament::modal width="7xl" icon="heroicon-o-squares-2x2"> <x-filament::modal width="7xl" icon="heroicon-o-squares-2x2" class="mx-4">
<x-slot name="trigger"> <x-slot name="trigger">
<x-filament::button outlined icon="heroicon-o-squares-2x2" color="gray"> <x-filament::button outlined icon="heroicon-o-squares-2x2" color="gray">
Event Mapper Event Mapper
@@ -22,18 +22,19 @@
</x-slot> </x-slot>
{{-- Modal content --}} {{-- Modal content --}}
<div class="grid grid-cols-2 gap-4"> <div class="grid grid-cols-2 gap-4">
<div> <div>
@livewire('mapper-events') @livewire('mapper-left')
</div> </div>
<div> <div>
@livewire('mapper-clients') @livewire('mapper-right')
</div> </div>
</div> </div>
</x-filament::modal> </x-filament::modal>
<x-filament::dropdown> <x-filament::dropdown class="mx-4">
<x-slot name="trigger"> <x-slot name="trigger">
<x-filament::button outlined icon="heroicon-o-adjustments-horizontal" color="gray"> <x-filament::button outlined icon="heroicon-o-adjustments-horizontal" color="gray">
Settings Settings
@@ -119,20 +120,21 @@
</x-filament::dropdown> </x-filament::dropdown>
@endif @endif
<x-filament::dropdown> @if (auth()->user()->hasRole('konto_switch'))
<x-slot name="trigger"> <x-filament::dropdown>
<x-filament::button icon="phosphor-user"> <x-slot name="trigger">
{{ $client }} <x-filament::button icon="phosphor-user">
</x-filament::button> {{ $client }}
</x-slot> </x-filament::button>
</x-slot>
<x-filament::dropdown.list>
@foreach ($clients as $id => $name)
<x-filament::dropdown.list.item wire:click="swop({{ $id }})" icon="phosphor-key">
{{ $name }}
</x-filament::dropdown.list.item>
@endforeach
</x-filament::dropdown.list>
</x-filament::dropdown>
<x-filament::dropdown.list>
@foreach ($clients as $id => $name)
<x-filament::dropdown.list.item wire:click="swop({{ $id }})" icon="phosphor-key">
{{ $name }}
</x-filament::dropdown.list.item>
@endforeach
</x-filament::dropdown.list>
</x-filament::dropdown>
@endif
</div> </div>
+26 -12
View File
@@ -4,21 +4,25 @@ case "$1" in
"1") "1")
git pull git pull
composer update composer update
npm update php artisan optimize
php artisan optimize
;; ;;
"2") "2")
php artisan migrate:fresh --force php artisan migrate:fresh --force
php artisan db:seed --force php artisan shield:generate --all
php artisan optimize:clear php artisan optimize:clear
php artisan filament:assets
php artisan optimize php artisan optimize
php artisan db:seed --force
;; ;;
"3") "3")
php artisan route:clear php artisan filament:optimize-clear
php artisan cache:clear php artisan view:clear
php artisan icons:clear php artisan optimize:clear
php artisan optimize php artisan route:clear
php artisan filament:assets php artisan cache:clear
php artisan icons:clear
php artisan config:clear
php artisan optimize
npm run build npm run build
;; ;;
"4") "4")
@@ -30,17 +34,27 @@ case "$1" in
"6") "6")
php artisan filament:assets php artisan filament:assets
;; ;;
"7")
php artisan db:seed --force
;;
"8")
php artisan cache:clear
php artisan config:clear
php artisan view:clear
;;
*) *)
echo "" echo ""
echo "--------------------------" echo "--------------------------"
echo "setup nuh lives" echo "setup nuh lives"
echo "--------------------------" echo "--------------------------"
echo "1 => git pull, composer update, npm update, optimize" echo "1 => git pull & composer update & optimize"
echo "2 => db fresh & seed" echo "2 => a db fresh"
echo "3 => cache, optimize & storage" echo "3 => empty cache & optimize"
echo "4 => chown -R apache:apache ." echo "4 => chown -R apache:apache ."
echo "5 => a storage:link" echo "5 => a storage:link"
echo "6 => a filament:assets -> copy to prod" echo "6 => a filament:assets (copy to prod)"
echo "7 => a db:seed --force"
echo "8 => a cache:clear view:clear"
echo "--------------------------" echo "--------------------------"
echo "" echo ""
;; ;;