wip countries
This commit is contained in:
1 parent
641b362752
commit
1b9a65b25a
23 files changed
+127755
-27137
No files matched your search
@@ -6,7 +6,6 @@ use App\Models\Liga;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
@@ -23,16 +22,13 @@ class EventsTable
|
||||
return $record->sport->icon;
|
||||
}),
|
||||
TextColumn::make('starttime')->dateTime('M j, Y H:i')->sortable(),
|
||||
// IconColumn::make('liga_id')->label('Flag')
|
||||
// ->icon(fn (string $state): Heroicon => match ($state) {
|
||||
// default => Heroicon::OutlinedPencil,
|
||||
// // return Liga::where('id', $state)->value('country.icon')->first();
|
||||
// }),
|
||||
TextColumn::make('liga.country.name'),
|
||||
// TextColumn::make('liga.name')->searchable()
|
||||
// ->icon(fn (string $record): string => match ($record) {
|
||||
// default => $record->liga->country->icon
|
||||
// }),
|
||||
IconColumn::make('country_id')
|
||||
->label('Flag')
|
||||
->icon(function ($record): string {
|
||||
return $record->country->icon;
|
||||
}),
|
||||
TextColumn::make('country.name'),
|
||||
TextColumn::make('liga.name'),
|
||||
TextColumn::make('home.name')->searchable(),
|
||||
TextColumn::make('away.name')->searchable(),
|
||||
// TextColumn::make('prid')
|
||||
|
||||
@@ -8,12 +8,15 @@ use App\Models\Country;
|
||||
use BackedEnum;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Enums\IconSize;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use UnitEnum;
|
||||
|
||||
class CountryResource extends Resource
|
||||
@@ -34,13 +37,14 @@ class CountryResource extends Resource
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextInput::make('name')->required()->maxLength(255)->copyable(),
|
||||
TextInput::make('icon')->maxLength(255),
|
||||
TextInput::make('name')->required(),
|
||||
TextInput::make('icon'),
|
||||
TextInput::make('iso2')->maxLength(2),
|
||||
TextInput::make('iso3')->maxLength(2),
|
||||
TextInput::make('cc')->maxLength(2),
|
||||
TextInput::make('numeric')->maxLength(2),
|
||||
TextInput::make('txid')->maxLength(4),
|
||||
TextInput::make('iso3')->maxLength(3),
|
||||
TextInput::make('cc'),
|
||||
TextInput::make('numeric'),
|
||||
TextInput::make('txid'),
|
||||
Toggle::make('other'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -49,6 +53,7 @@ class CountryResource extends Resource
|
||||
return $table
|
||||
->recordTitleAttribute('name')
|
||||
->columns([
|
||||
TextColumn::make('id')->searchable(),
|
||||
IconColumn::make('icon')
|
||||
->sortable()
|
||||
->icon(function ($state): string {
|
||||
@@ -63,12 +68,15 @@ class CountryResource extends Resource
|
||||
TextColumn::make('iso3'),
|
||||
TextColumn::make('cc'),
|
||||
TextColumn::make('numeric'),
|
||||
TextColumn::make('txid'),
|
||||
TextColumn::make('txid')->searchable(),
|
||||
TextColumn::make('other'),
|
||||
|
||||
])
|
||||
->defaultSort('name', direction: 'asc')
|
||||
->filters([
|
||||
//
|
||||
Filter::make('icon')
|
||||
->label('Missing Icons')
|
||||
->query(fn (Builder $query): Builder => $query->whereNull('icon')),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
|
||||
@@ -27,6 +27,14 @@ class SupervisorForm
|
||||
])
|
||||
->default('Grapper')
|
||||
->selectablePlaceholder(false),
|
||||
Select::make('filetype')
|
||||
->label('File Type')
|
||||
->options([
|
||||
'json' => 'json',
|
||||
'xml' => 'xml',
|
||||
])
|
||||
->default('json')
|
||||
->selectablePlaceholder(false),
|
||||
Select::make('provider_id')
|
||||
->relationship('provider', 'name')
|
||||
->required()
|
||||
|
||||
@@ -39,6 +39,7 @@ class SupervisorsTable
|
||||
TextColumn::make('runtime'),
|
||||
TextColumn::make('lastcall'),
|
||||
IconColumn::make('is_cron')->boolean()->label('Cron')->falseColor('gray'),
|
||||
TextColumn::make('filetype')->badge()->alignCenter(),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
||||
Reference in new issue
Block a user