wip
This commit is contained in:
1 parent
21bfa6ecc3
commit
4bce04cd64
2 files changed
+7
-45
No files matched your search
@@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Actions\LoadStatisticFixturesLeaguesOptions;
|
||||
use App\Models\CompetitionGroup;
|
||||
use App\Models\Element;
|
||||
use App\Models\StatisticFixtures;
|
||||
use BackedEnum;
|
||||
@@ -38,7 +37,10 @@ class Statistic extends BaseDashboard
|
||||
->preload()
|
||||
->searchable()
|
||||
->live()
|
||||
->label('League'),
|
||||
->label('League')
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
$set('team_id', null);
|
||||
}),
|
||||
Select::make('team_id')
|
||||
->prefixIcon('icon-team')
|
||||
->options(function (Get $get) {
|
||||
@@ -67,13 +69,9 @@ class Statistic extends BaseDashboard
|
||||
Select::make('palyer_id')
|
||||
->label('Player')
|
||||
->prefixIcon('icon-player')
|
||||
->options(function () {
|
||||
$res = StatisticFixtures::where('sport_id', 1)
|
||||
->groupBy('league_id')
|
||||
->pluck('league_id')->toArray();
|
||||
|
||||
return CompetitionGroup::query()->whereIn('id', $res)->orderBy('name')->pluck('name', 'id');
|
||||
})
|
||||
->options([
|
||||
'draft' => 'Sep Maier',
|
||||
])
|
||||
->preload()
|
||||
->searchable()
|
||||
->live(),
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\Grid;
|
||||
use Filament\Forms\Concerns\InteractsWithForms;
|
||||
use Filament\Forms\Contracts\HasForms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Widgets\Widget;
|
||||
|
||||
class StatisticFilters extends Widget implements HasForms
|
||||
{
|
||||
use InteractsWithForms;
|
||||
|
||||
protected string $view = 'filament.widgets.statistic-filters';
|
||||
|
||||
protected int|string|array $columnSpan = 'full';
|
||||
|
||||
protected static ?int $sort = 1;
|
||||
|
||||
public ?array $data = [];
|
||||
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->statePath('data')
|
||||
->schema([
|
||||
Grid::make()
|
||||
->schema([
|
||||
DatePicker::make('from'),
|
||||
DatePicker::make('to'),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user