This commit is contained in:
salam committed 2026-10-08 15:33:05 +02:00
1 parent 29018914d1
commit 8cb1d428cb
17 files changed
+214 -165

No files matched your search

@@ -2,8 +2,6 @@
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreCategories;
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Pages\CreateSofaScoreCategory;
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Pages\EditSofaScoreCategory;
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Pages\ListSofaScoreCategories;
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Schemas\SofaScoreCategoryForm;
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Tables\SofaScoreCategoriesTable;
@@ -23,11 +21,12 @@ class SofaScoreCategoryResource extends Resource
protected static ?int $navigationSort = 13;
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
protected static ?string $recordTitleAttribute = 'SS Countries';
protected static ?string $navigationLabel = 'SS Countries';
protected static ?string $recordTitleAttribute = 'Countries';
protected static ?string $modelLabel = 'SS Countries';
protected static ?string $navigationLabel = 'Countries';
protected static ?string $modelLabel = 'Countries';
public static function form(Schema $schema): Schema
{
@@ -20,9 +20,9 @@ class StatistikoConfigResource extends Resource
protected static ?string $cluster = StaticDataCluster::class;
protected static ?string $navigationLabel = 'Configurations';
protected static ?string $navigationLabel = 'Aspettativa';
protected static ?string $modelLabel = 'Configurations';
protected static ?string $modelLabel = 'Aspettativa';
protected static ?int $navigationSort = 15;
@@ -42,6 +42,7 @@ class StatistikoConfigResource extends Resource
'index' => ListStatistikoConfigs::route('/'),
];
}
public static function getNavigationBadge(): ?string
{
return parent::getEloquentQuery()->count();
@@ -14,7 +14,7 @@ class StatistikoConfigsTable
{
return $table
->columns([
TextColumn::make('group')->formatStateUsing(fn(string $state): string => match ($state) {
TextColumn::make('group')->formatStateUsing(fn (string $state): string => match ($state) {
'gls' => 'Goals',
'crn' => 'Corner',
'fls' => 'Fouls',
@@ -22,20 +22,28 @@ class StatistikoConfigsTable
'crd' => 'Cards',
'snt' => 'Shots On Target',
'tsh' => 'Total Shots',
'all' => 'Method B',
}),
TextColumn::make('team')->badge()
->color(fn(string $state): string => match ($state) {
->color(fn (string $state): string => match ($state) {
'home' => 'info',
'away' => 'warning',
}),
TextColumn::make('varname')
->formatStateUsing(fn(string $state): string => strtoupper($state)),
->formatStateUsing(fn (string $state): string => strtoupper($state)),
TextInputColumn::make('value')
->prefix('xx.x')
->type('number')
->rules(['required', 'decimal:0.1,10']),
])
->filters([
SelectFilter::make('type')
->label('Calculation')
->default('B')
->options([
'A' => 'Type A',
'B' => 'Type B',
]),
SelectFilter::make('group')
->options([
'gls' => 'Goals',
@@ -50,7 +58,7 @@ class StatistikoConfigsTable
->options([
'home' => 'Home',
'away' => 'Away',
])
]),
], layout: FiltersLayout::AboveContent)
->deferFilters(false);
}
@@ -16,6 +16,10 @@ class StatistikoDetailResource extends Resource
{
protected static ?string $model = StatistikoDetail::class;
protected static bool $shouldSkipAuthorization = true;
protected static bool $shouldRegisterNavigation = true;
protected static ?string $navigationLabel = 'Details';
protected static ?string $modelLabel = 'Details';