You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace App\Filament\Company\Pages;
  3. use Filament\Forms\Components\DatePicker;
  4. use Filament\Forms\Components\Section;
  5. use Filament\Forms\Form;
  6. use Filament\Forms\Set;
  7. use Filament\Pages\Dashboard\Actions\FilterAction;
  8. use Filament\Pages\Dashboard\Concerns\HasFiltersAction;
  9. class Dashboard extends \Filament\Pages\Dashboard
  10. {
  11. use HasFiltersAction;
  12. // public function filtersForm(Form $form): Form
  13. // {
  14. // return $form
  15. // ->schema([
  16. // Section::make()
  17. // ->schema([
  18. // DatePicker::make('startDate'),
  19. // DatePicker::make('endDate'),
  20. // // ...
  21. // ])
  22. // ->columns(3),
  23. // ]);
  24. // }
  25. protected function getHeaderActions(): array
  26. {
  27. return [
  28. FilterAction::make()
  29. ->form([
  30. DatePicker::make('startDate')
  31. ->live()
  32. ->afterStateUpdated(fn (Set $set) => $set('endDate', now()->toDateTimeString())),
  33. DatePicker::make('endDate'),
  34. // ...
  35. ]),
  36. ];
  37. }
  38. }