wip
This commit is contained in:
1 parent
c1892e86aa
commit
82f6d5e7be
6 files changed
+246
-230
No files matched your search
@@ -20,9 +20,9 @@ class SofaScoreRosaResource extends Resource
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
protected static ?string $navigationLabel = 'Rosa';
|
||||
protected static ?string $navigationLabel = 'Rooster';
|
||||
|
||||
protected static ?string $modelLabel = 'Rosa';
|
||||
protected static ?string $modelLabel = 'Rooster';
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'SofaScore';
|
||||
|
||||
|
||||
+7
-10
@@ -6,11 +6,13 @@ use App\Models\SofaScoreCategory;
|
||||
use App\Models\SofaScoreTournament;
|
||||
use App\Models\Sport;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Forms\Components\ToggleButtons;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Columns\ToggleColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Table;
|
||||
@@ -37,7 +39,7 @@ class SofaScoreTournamentsTable
|
||||
TextColumn::make('sofascore_category.name')
|
||||
->icon(fn($record) => $record->sofascore_category->country->icon),
|
||||
TextColumn::make('name')->searchable()->sortable(),
|
||||
// ToggleColumn::make('enabled')->label('Enable'),
|
||||
ToggleColumn::make('enabled')->label('In Statistiko')->alignCenter(),
|
||||
// ToggleColumn::make('disabled')->label('Hidden'),
|
||||
])
|
||||
->filters([
|
||||
@@ -67,20 +69,15 @@ class SofaScoreTournamentsTable
|
||||
return SofaScoreCategory::query()->whereIn('id', $res)->orderBy('name')->pluck('name', 'id');
|
||||
})
|
||||
->live(),
|
||||
// ToggleButtons::make('filter-disabled')
|
||||
// ->inline()
|
||||
// ->columnSpan(2)
|
||||
// ->default('active')
|
||||
// ->options([
|
||||
// 'all' => 'All',
|
||||
// 'enabled' => 'Enabled',
|
||||
// 'hidden' => 'Hidden',
|
||||
// ]),
|
||||
Toggle::make('enabled')->label('In Statistiko'),
|
||||
])
|
||||
->query(function (Builder $query, array $data): Builder {
|
||||
return $query->when(
|
||||
$data['sport_id'],
|
||||
fn(Builder $query, $sport_id) => $query->where('sport_id', $sport_id)
|
||||
)->when(
|
||||
$data['enabled'],
|
||||
fn(Builder $query, $enabled) => $query->where('enabled', $enabled)
|
||||
)->when(
|
||||
$data['sofa_score_category_id'],
|
||||
function (Builder $query, $sofa_score_category_id) {
|
||||
|
||||
Reference in new issue
Block a user