fix flags

This commit is contained in:
salam committed 2026-02-24 17:27:47 +01:00
1 parent 2cdc70f5a4
commit 7acb1375d4
11 files changed
+1035 -14

No files matched your search

+2
View File
@@ -27,6 +27,7 @@ class LoadEvents
$query = Event::query()
->with('home')
->with('away')
->where('has_markets', 1)
->where('sport_id', auth()->user()->sport_id)
->where(function ($query) use ($element_ids) {
$query->orWhereIn('home_id', $element_ids)->orWhereIn('away_id', $element_ids);
@@ -35,6 +36,7 @@ class LoadEvents
$query = Event::query()
->with('home')
->with('away')
->where('has_markets', 1)
->where('sport_id', auth()->user()->sport_id);
}
@@ -5,7 +5,7 @@ namespace App\Livewire\Mapper;
use App\Models\Event;
use App\Models\Mapper;
class LoadProvider
class LoadMapper
{
public static function load($search_values)
{
@@ -30,6 +30,7 @@ class LoadProvider
} else {
return Mapper::query()
->with('country_magloo')
->where('sport_id', auth()->user()->sport_id)
->where('provider_id', auth()->user()->provider_id);
}
+9 -3
View File
@@ -3,7 +3,7 @@
namespace App\Livewire;
use App\Filament\Tables\Columns\MapperRightColumn;
use App\Livewire\Mapper\LoadProvider;
use App\Livewire\Mapper\LoadMapper;
use App\Livewire\Mapper\SearchString;
use App\Livewire\Mapper\StoreMapped;
use App\Models\Country;
@@ -65,7 +65,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
public function table(Table $table): Table
{
return $table
->query(LoadProvider::load($this->search_values))
->query(LoadMapper::load($this->search_values))
->striped()
->columns([
MapperRightColumn::make('left')->label('Event')->alignCenter(),
@@ -84,7 +84,13 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
$this->dispatch('refreshMapperRight');
}
}),
IconColumn::make('group_cc')->icon(fn (string $state): string => 'flag-country-'.$state)->label(''),
IconColumn::make('country_magloo.icon')
->label('')
->icon(fn (string $state): string => $state)
->visible(fn () => in_array(auth()->user()->provider_id, [3, 4])),
IconColumn::make('group_cc')
->visible(fn () => auth()->user()->provider_id == 2)
->icon(fn (string $state): string => 'flag-country-'.$state)->label(''),
IconColumn::make('sport.icon')
->label('')
->icon(fn ($record) => $record->sport->icon)