A demonstration of selecting form values and exporting data based on those selections.
We have a custom Filament page with a form to select a date and a customer.
app/Filament/Pages/Download.php:
use Filament\Schemas\Schema;use Filament\Pages\Page;use App\Models\Customer;use Filament\Support\Icons\Heroicon;use Filament\Forms\Components\Select;use Filament\Forms\Components\DatePicker; class Download extends Page{ protected static string | \BackedEnum | null $navigationIcon = Heroicon::OutlinedDocumentText; protected string $view = 'filament.pages.download'; public ?array $data = []; public function mount(): void { $this->form->fill(); } public function form(Schema $schema): Schema { return $schema ->components([ DatePicker::make('trade_date') ->minDate(now()->subMonths(2)->startOfMonth()) ->maxDate(today()), Select::make('customer') ->required() ->options(Customer::pluck('name', 'id')), ]) ->statePath('data'); }}