This commit is contained in:
salam committed 2026-06-14 11:09:49 +02:00
1 parent b01d336a05
commit cb20a72fcb
1 file changed
+64 -66
@@ -69,106 +69,106 @@ class EventsTable
->columns([ ->columns([
IconColumn::make('sport.icon') IconColumn::make('sport.icon')
->label('') ->label('')
->icon(fn ($record) => $record->sport->icon) ->icon(fn($record) => $record->sport->icon)
->tooltip(fn ($record) => $record->id) ->tooltip(fn($record) => $record->id)
->visibleFrom('lg'), ->visibleFrom('lg'),
MatchIds::make('ids')->grow(false)->visibleFrom('xl') MatchIds::make('ids')->grow(false)->visibleFrom('xl')
->visible(fn () => auth()->user()->hasRole('super_admin')), ->visible(fn() => auth()->user()->hasRole('super_admin')),
ColumnStarttime::make('start'), ColumnStarttime::make('start'),
TextColumn::make('country.name') TextColumn::make('country.name')
->label('League') ->label('League')
->wrap() ->wrap()
->hidden(fn () => auth()->user()->sport_id == 5) ->hidden(fn() => auth()->user()->sport_id == 5)
->color('gray') ->color('gray')
->icon(fn ($record) => $record->country?->icon) ->icon(fn($record) => $record->country?->icon)
->description(fn ($record) => ucwords($record->group?->name)), ->description(fn($record) => ucwords($record->group?->name)),
EventColumn::make('event'), EventColumn::make('event'),
TooltipOdds::make('ml')->bettype('odds_2ways')->label('')->visible(fn () => in_array('odds_2ways', self::$bettype_settings)), TooltipOdds::make('ml')->bettype('odds_2ways')->label('')->visible(fn() => in_array('odds_2ways', self::$bettype_settings)),
ColumnOdds::make('odds_2ways')->bettype('odds_2ways') ColumnOdds::make('odds_2ways')->bettype('odds_2ways')
->visible(fn () => in_array('odds_2ways', self::$bettype_settings)) ->visible(fn() => in_array('odds_2ways', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('ML'), ->label('ML'),
TooltipOdds::make('mls1')->bettype('odds_2ways_s1')->label('')->visible(fn () => in_array('odds_2ways_s1', self::$bettype_settings)), TooltipOdds::make('mls1')->bettype('odds_2ways_s1')->label('')->visible(fn() => in_array('odds_2ways_s1', self::$bettype_settings)),
ColumnOdds::make('odds_2ways_s1')->bettype('odds_2ways_s1') ColumnOdds::make('odds_2ways_s1')->bettype('odds_2ways_s1')
->visible(fn () => in_array('odds_2ways_s1', self::$bettype_settings)) ->visible(fn() => in_array('odds_2ways_s1', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('ML S1'), ->label('ML S1'),
TooltipOdds::make('1x2')->bettype('odds_3ways')->label('')->visible(fn () => in_array('odds_3ways', self::$bettype_settings)), TooltipOdds::make('1x2')->bettype('odds_3ways')->label('')->visible(fn() => in_array('odds_3ways', self::$bettype_settings)),
ColumnOdds::make('odds_3ways') ColumnOdds::make('odds_3ways')
->bettype('odds_3ways') ->bettype('odds_3ways')
->visible(fn () => in_array('odds_3ways', self::$bettype_settings)) ->visible(fn() => in_array('odds_3ways', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('1X2'), ->label('1X2'),
TooltipOdds::make('1x2ht')->bettype('odds_3ways_ht')->label('')->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings)), TooltipOdds::make('1x2ht')->bettype('odds_3ways_ht')->label('')->visible(fn() => in_array('odds_3ways_ht', self::$bettype_settings)),
ColumnOdds::make('odds_3ways_ht')->bettype('odds_3ways_ht') ColumnOdds::make('odds_3ways_ht')->bettype('odds_3ways_ht')
->visible(fn () => in_array('odds_3ways_ht', self::$bettype_settings)) ->visible(fn() => in_array('odds_3ways_ht', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('1X2 HT'), ->label('1X2 HT'),
TooltipOdds::make('total')->bettype('odds_totals')->label('')->visible(fn () => in_array('odds_totals', self::$bettype_settings)), TooltipOdds::make('total')->bettype('odds_totals')->label('')->visible(fn() => in_array('odds_totals', self::$bettype_settings)),
ColumnOdds::make('odds_totals')->bettype('odds_totals') ColumnOdds::make('odds_totals')->bettype('odds_totals')
->visible(fn () => in_array('odds_totals', self::$bettype_settings)) ->visible(fn() => in_array('odds_totals', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('Totals'), ->label('Totals'),
TooltipOdds::make('total_ht')->bettype('odds_totals_ht')->label('')->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings)), TooltipOdds::make('total_ht')->bettype('odds_totals_ht')->label('')->visible(fn() => in_array('odds_totals_ht', self::$bettype_settings)),
ColumnOdds::make('odds_totals_ht')->bettype('odds_totals_ht') ColumnOdds::make('odds_totals_ht')->bettype('odds_totals_ht')
->visible(fn () => in_array('odds_totals_ht', self::$bettype_settings)) ->visible(fn() => in_array('odds_totals_ht', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('Totals HT'), ->label('Totals HT'),
TooltipOdds::make('total_q1')->bettype('odds_totals_q1')->label('')->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings)), TooltipOdds::make('total_q1')->bettype('odds_totals_q1')->label('')->visible(fn() => in_array('odds_totals_q1', self::$bettype_settings)),
ColumnOdds::make('odds_totals_q1')->bettype('odds_totals_q1') ColumnOdds::make('odds_totals_q1')->bettype('odds_totals_q1')
->visible(fn () => in_array('odds_totals_q1', self::$bettype_settings)) ->visible(fn() => in_array('odds_totals_q1', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->alignCenter() ->alignCenter()
->label('Totals Q1'), ->label('Totals Q1'),
TooltipOdds::make('points')->bettype('odds_points')->label('')->visible(fn () => in_array('odds_points', self::$bettype_settings)), TooltipOdds::make('points')->bettype('odds_points')->label('')->visible(fn() => in_array('odds_points', self::$bettype_settings)),
ColumnOdds::make('odds_points')->bettype('odds_points') ColumnOdds::make('odds_points')->bettype('odds_points')
->visible(fn () => in_array('odds_points', self::$bettype_settings)) ->visible(fn() => in_array('odds_points', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('Points'), ->label('Points'),
TooltipOdds::make('points_ht')->bettype('odds_points_ht')->label('')->visible(fn () => in_array('odds_points_ht', self::$bettype_settings)), TooltipOdds::make('points_ht')->bettype('odds_points_ht')->label('')->visible(fn() => in_array('odds_points_ht', self::$bettype_settings)),
ColumnOdds::make('odds_points_ht')->bettype('odds_points_ht') ColumnOdds::make('odds_points_ht')->bettype('odds_points_ht')
->visible(fn () => in_array('odds_points_ht', self::$bettype_settings)) ->visible(fn() => in_array('odds_points_ht', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('Points HT'), ->label('Points HT'),
TooltipOdds::make('points_q1')->bettype('odds_points_q1')->label('')->visible(fn () => in_array('odds_points_q1', self::$bettype_settings)), TooltipOdds::make('points_q1')->bettype('odds_points_q1')->label('')->visible(fn() => in_array('odds_points_q1', self::$bettype_settings)),
ColumnOdds::make('odds_points_q1')->bettype('odds_points_q1') ColumnOdds::make('odds_points_q1')->bettype('odds_points_q1')
->visible(fn () => in_array('odds_points_q1', self::$bettype_settings)) ->visible(fn() => in_array('odds_points_q1', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('Points Q1'), ->label('Points Q1'),
TooltipOdds::make('ggng')->bettype('odds_ggng')->label('')->visible(fn () => in_array('odds_ggng', self::$bettype_settings)), TooltipOdds::make('ggng')->bettype('odds_ggng')->label('')->visible(fn() => in_array('odds_ggng', self::$bettype_settings)),
ColumnOdds::make('odds_ggng')->bettype('odds_ggng') ColumnOdds::make('odds_ggng')->bettype('odds_ggng')
->visible(fn () => \in_array('odds_ggng', self::$bettype_settings)) ->visible(fn() => \in_array('odds_ggng', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('Goal No Goal'), ->label('Goal No Goal'),
TooltipOdds::make('dc')->bettype('odds_dc')->label('')->visible(fn () => in_array('odds_dc', self::$bettype_settings)), TooltipOdds::make('dc')->bettype('odds_dc')->label('')->visible(fn() => in_array('odds_dc', self::$bettype_settings)),
ColumnOdds::make('odds_dc')->bettype('odds_dc') ColumnOdds::make('odds_dc')->bettype('odds_dc')
->visible(fn () => \in_array('odds_dc', self::$bettype_settings)) ->visible(fn() => \in_array('odds_dc', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('Double Chance'), ->label('Double Chance'),
TooltipOdds::make('tq')->bettype('odds_tq')->label('')->visible(fn () => in_array('odds_tq', self::$bettype_settings)), TooltipOdds::make('tq')->bettype('odds_tq')->label('')->visible(fn() => in_array('odds_tq', self::$bettype_settings)),
ColumnOdds::make('odds_tq')->bettype('odds_tq') ColumnOdds::make('odds_tq')->bettype('odds_tq')
->visible(fn () => \in_array('odds_tq', self::$bettype_settings)) ->visible(fn() => \in_array('odds_tq', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('To Qualify'), ->label('To Qualify'),
TooltipOdds::make('dnb')->bettype('odds_dnb')->label('')->visible(fn () => in_array('odds_dnb', self::$bettype_settings)), TooltipOdds::make('dnb')->bettype('odds_dnb')->label('')->visible(fn() => in_array('odds_dnb', self::$bettype_settings)),
ColumnOdds::make('odds_dnb')->bettype('odds_dnb') ColumnOdds::make('odds_dnb')->bettype('odds_dnb')
->visible(fn () => \in_array('odds_dnb', self::$bettype_settings)) ->visible(fn() => \in_array('odds_dnb', self::$bettype_settings))
->verticalAlignment(VerticalAlignment::Start) ->verticalAlignment(VerticalAlignment::Start)
->label('Draw No Bet'), ->label('Draw No Bet'),
]) ])
@@ -195,7 +195,7 @@ class EventsTable
->options(function () { ->options(function () {
$res = Event::where('has_markets', 1) $res = Event::where('has_markets', 1)
->where('sport_id', auth()->user()->sport_id) ->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>=', Carbon::now()) ->whereDate('starttime', '>=', Carbon::now())
->groupBy('country_id') ->groupBy('country_id')
->pluck('country_id')->toArray(); ->pluck('country_id')->toArray();
@@ -219,7 +219,7 @@ class EventsTable
->with('country') ->with('country')
->with('competition_group') ->with('competition_group')
->where('sport_id', auth()->user()->sport_id) ->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>', Carbon::now()) ->whereDate('starttime', '>', Carbon::now())
->whereIn('country_id', $get('country_id')) ->whereIn('country_id', $get('country_id'))
->groupBy('competition_group_id')->get(); ->groupBy('competition_group_id')->get();
} else { } else {
@@ -227,13 +227,13 @@ class EventsTable
->with('country') ->with('country')
->with('competition_group') ->with('competition_group')
->where('sport_id', auth()->user()->sport_id) ->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>', Carbon::now()) ->whereDate('starttime', '>', Carbon::now())
->groupBy('competition_group_id')->get(); ->groupBy('competition_group_id')->get();
} }
$arr = []; $arr = [];
foreach ($res as $val) { foreach ($res as $val) {
$arr[$val->competition_group_id] = $val->country?->name.' '.$val->competition_group?->name; $arr[$val->competition_group_id] = $val->country?->name . ' ' . $val->competition_group?->name;
} }
asort($arr); asort($arr);
@@ -241,7 +241,7 @@ class EventsTable
}) })
->live(), ->live(),
Select::make('competition_group_id') Select::make('competition_group_id')
->visible(fn () => auth()->user()->sport_id == 5) ->visible(fn() => auth()->user()->sport_id == 5)
->placeholder('Tournament') ->placeholder('Tournament')
->prefixIcon('phosphor-trophy') ->prefixIcon('phosphor-trophy')
->columnSpan(2) ->columnSpan(2)
@@ -253,7 +253,7 @@ class EventsTable
$res = Event::where('has_markets', 1) $res = Event::where('has_markets', 1)
->with('competition_group') ->with('competition_group')
->where('sport_id', auth()->user()->sport_id) ->where('sport_id', auth()->user()->sport_id)
->where('starttime', '>', Carbon::now()) ->whereDate('starttime', '>', Carbon::now())
->groupBy('competition_group_id') ->groupBy('competition_group_id')
->get(); ->get();
$arr = []; $arr = [];
@@ -272,7 +272,7 @@ class EventsTable
->hiddenLabel() ->hiddenLabel()
->label('') ->label('')
->preload() ->preload()
->options(fn () => ClientGroupList::where('sport_id', auth()->user()->sport_id) ->options(fn() => ClientGroupList::where('sport_id', auth()->user()->sport_id)
->where('client_id', auth()->user()->client_id) ->where('client_id', auth()->user()->client_id)
->pluck('name', 'id')) ->pluck('name', 'id'))
->live(), ->live(),
@@ -301,7 +301,7 @@ class EventsTable
->prefixIcon('phosphor-funnel') ->prefixIcon('phosphor-funnel')
->hiddenLabel() ->hiddenLabel()
->allowHtml() ->allowHtml()
->options(fn () => CompareOptions::load()), ->options(fn() => CompareOptions::load()),
]) ])
->query(function (Builder $query, array $data): Builder { ->query(function (Builder $query, array $data): Builder {
return $query->when( return $query->when(
@@ -311,7 +311,7 @@ class EventsTable
} }
)->when( )->when(
$data['competition_group_id'], $data['competition_group_id'],
fn (Builder $query, $competition_group_id) => $query->whereIn('competition_group_id', $competition_group_id) fn(Builder $query, $competition_group_id) => $query->whereIn('competition_group_id', $competition_group_id)
)->when( )->when(
$data['client_group_list_id'], $data['client_group_list_id'],
@@ -330,18 +330,18 @@ class EventsTable
$end = Carbon::createFromDate($starttime_period['end']); $end = Carbon::createFromDate($starttime_period['end']);
return $query return $query
->where('starttime', '>=', $from) ->whereDate('starttime', '>=', $from)
->where('starttime', '<=', $end); ->whereDate('starttime', '<=', $end);
} elseif (isset($starttime_period['start'])) { } elseif (isset($starttime_period['start'])) {
$from = Carbon::createFromDate($starttime_period['start']); $from = Carbon::createFromDate($starttime_period['start']);
return $query return $query
->where('starttime', '>=', $from); ->whereDate('starttime', '>=', $from);
} elseif (isset($starttime_period['end'])) { } elseif (isset($starttime_period['end'])) {
$end = Carbon::createFromDate($starttime_period['end']); $end = Carbon::createFromDate($starttime_period['end']);
return $query return $query
->where('starttime', '<=', $end); ->whereDate('starttime', '<=', $end);
} }
} }
)->when( )->when(
@@ -408,7 +408,6 @@ class EventsTable
case 5: case 5:
$event_ids = LoadCompareDifferences::load($opt[0], $opt[1], 'odds_2ways', $compare_bookmaker_id); $event_ids = LoadCompareDifferences::load($opt[0], $opt[1], 'odds_2ways', $compare_bookmaker_id);
break; break;
} }
$query->whereIn('id', $event_ids); $query->whereIn('id', $event_ids);
} }
@@ -418,7 +417,8 @@ class EventsTable
function (Builder $query, $filter_stars) { function (Builder $query, $filter_stars) {
$query->whereHas('event_user_star'); $query->whereHas('event_user_star');
} }
)->when(in_array('odds_tq', self::$bettype_settings), )->when(
in_array('odds_tq', self::$bettype_settings),
function (Builder $query, $filter_stars) { function (Builder $query, $filter_stars) {
$query->whereHas('odds_tq'); $query->whereHas('odds_tq');
} }
@@ -452,7 +452,6 @@ class EventsTable
$query->where('bookmaker_id', auth()->user()->bookmaker_id)->whereRaw('LEAST(h2w, a2w) BETWEEN ? AND ?', [1, $favorit_threshold]); $query->where('bookmaker_id', auth()->user()->bookmaker_id)->whereRaw('LEAST(h2w, a2w) BETWEEN ? AND ?', [1, $favorit_threshold]);
}); });
break; break;
} }
} }
); );
@@ -478,7 +477,7 @@ class EventsTable
if ($data['client_group_list_id'] ?? null) { if ($data['client_group_list_id'] ?? null) {
$client_group_list_name = ClientGroupList::where('id', $data['client_group_list_id'])->value('name'); $client_group_list_name = ClientGroupList::where('id', $data['client_group_list_id'])->value('name');
$indicators[] = Indicator::make('Custom Group: '.$client_group_list_name)->removeField('client_group_list_id')->color('info'); $indicators[] = Indicator::make('Custom Group: ' . $client_group_list_name)->removeField('client_group_list_id')->color('info');
} }
if ($data['filter_stars'] ?? null) { if ($data['filter_stars'] ?? null) {
@@ -495,17 +494,17 @@ class EventsTable
if ($data['filter_alarm_green'] ?? null) { if ($data['filter_alarm_green'] ?? null) {
$title = OddsTable::where('name', $data['filter_alarm_green'])->value('title'); $title = OddsTable::where('name', $data['filter_alarm_green'])->value('title');
$indicators[] = Indicator::make('Alarms: '.$title)->removeField('filter_alarm_green')->color('success'); $indicators[] = Indicator::make('Alarms: ' . $title)->removeField('filter_alarm_green')->color('success');
} }
if ($data['filter_alarm_yellow'] ?? null) { if ($data['filter_alarm_yellow'] ?? null) {
$title = OddsTable::where('name', $data['filter_alarm_yellow'])->value('title'); $title = OddsTable::where('name', $data['filter_alarm_yellow'])->value('title');
$indicators[] = Indicator::make('Alarms: '.$title)->removeField('filter_alarm_yellow')->color('info'); $indicators[] = Indicator::make('Alarms: ' . $title)->removeField('filter_alarm_yellow')->color('info');
} }
if ($data['filter_alarm_red'] ?? null) { if ($data['filter_alarm_red'] ?? null) {
$title = OddsTable::where('name', $data['filter_alarm_red'])->value('title'); $title = OddsTable::where('name', $data['filter_alarm_red'])->value('title');
$indicators[] = Indicator::make('Alarms: '.$title)->removeField('filter_alarm_red')->color('danger'); $indicators[] = Indicator::make('Alarms: ' . $title)->removeField('filter_alarm_red')->color('danger');
} }
if ($data['starttime_period'] ?? null) { if ($data['starttime_period'] ?? null) {
@@ -515,7 +514,7 @@ class EventsTable
$text .= Carbon::parse($span['start'])->format('d. M.'); $text .= Carbon::parse($span['start'])->format('d. M.');
} }
if ($span['end'] ?? null) { if ($span['end'] ?? null) {
$text .= ' - '.Carbon::parse($span['end'])->format('d. M.'); $text .= ' - ' . Carbon::parse($span['end'])->format('d. M.');
} }
if ($text) { if ($text) {
$indicators[] = Indicator::make($text)->removeField('starttime_period.start')->color('info'); $indicators[] = Indicator::make($text)->removeField('starttime_period.start')->color('info');
@@ -534,18 +533,17 @@ class EventsTable
if ($data['favorit_threshold'] ?? null) { if ($data['favorit_threshold'] ?? null) {
switch (auth()->user()->sport_id) { switch (auth()->user()->sport_id) {
case 1: case 1:
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning'); $indicators[] = Indicator::make('1X2 Fav <= ' . $data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
break; break;
case 2: case 2:
$indicators[] = Indicator::make('1X2 Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning'); $indicators[] = Indicator::make('1X2 Fav <= ' . $data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
break; break;
case 3: case 3:
$indicators[] = Indicator::make('HC Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning'); $indicators[] = Indicator::make('HC Fav <= ' . $data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
break; break;
case 5: case 5:
$indicators[] = Indicator::make('ML Fav <= '.$data['favorit_threshold'])->removeField('favorit_threshold')->color('warning'); $indicators[] = Indicator::make('ML Fav <= ' . $data['favorit_threshold'])->removeField('favorit_threshold')->color('warning');
break; break;
} }
} }
@@ -619,7 +617,7 @@ class EventsTable
->modalIcon('phosphor-note-pencil-duotone') ->modalIcon('phosphor-note-pencil-duotone')
->modalWidth(Width::Large) ->modalWidth(Width::Large)
->modalSubmitActionLabel('Save') ->modalSubmitActionLabel('Save')
->extraModalFooterActions(fn (Action $action, $record) => $record->event_user_note->isEmpty() ? [] : [$action->makeModalSubmitAction('Delete', arguments: ['delete' => true])->color('danger')]) ->extraModalFooterActions(fn(Action $action, $record) => $record->event_user_note->isEmpty() ? [] : [$action->makeModalSubmitAction('Delete', arguments: ['delete' => true])->color('danger')])
->fillForm(data: function ($record) { ->fillForm(data: function ($record) {
foreach ($record->event_user_note as $value) { foreach ($record->event_user_note as $value) {
if ($value->user_id == auth()->user()->id && $value->bookmaker_id == auth()->user()->bookmaker_id) { if ($value->user_id == auth()->user()->id && $value->bookmaker_id == auth()->user()->bookmaker_id) {
@@ -640,7 +638,7 @@ class EventsTable
]) ])
->icon('phosphor-note-pencil-duotone') ->icon('phosphor-note-pencil-duotone')
->iconButton() ->iconButton()
->tooltip(fn ($record) => view('filament.resources.events.tooltip.event-user-note-tooltip', ['notes' => $record->event_user_note])) ->tooltip(fn($record) => view('filament.resources.events.tooltip.event-user-note-tooltip', ['notes' => $record->event_user_note]))
->action(function ($record, array $data, $arguments = []) { ->action(function ($record, array $data, $arguments = []) {
if ($arguments) { if ($arguments) {
EventUserNote::where('id', $data['event_user_note_id'])->delete(); EventUserNote::where('id', $data['event_user_note_id'])->delete();
@@ -661,14 +659,14 @@ class EventsTable
]); ]);
} }
}) })
->color(fn ($record) => $record->event_user_note->isEmpty() ? 'gray' : 'info'), ->color(fn($record) => $record->event_user_note->isEmpty() ? 'gray' : 'info'),
ActionGroup::make([ ActionGroup::make([
DeleteAction::make()->visible(fn () => auth()->user()->hasRole('super_admin')), 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()->hasRole('super_admin')) ->disabled(fn() => ! auth()->user()->hasRole('super_admin'))
->icon('phosphor-arrow-square-out') ->icon('phosphor-arrow-square-out')
->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(),
Action::make('swap_elements') Action::make('swap_elements')
->icon('phosphor-swap') ->icon('phosphor-swap')