filtersForm->fill([ 'plant' => Plant::first()?->id // Default to first plant ]); } public function filtersForm(Form $form): Form { return $form ->statePath('filters') // Store form state in 'filters' ->schema([ Select::make('plant') ->options(Plant::pluck('name', 'id')) ->label('Select Plant') ->reactive() ->afterStateUpdated(function ($state) { session(['selected_plant' => $state]); // fixed typo $this->dispatch('cumulativeChart'); // custom Livewire event }), ]); } public static function getNavigationLabel(): string { return 'Production Line Count'; } public function getHeading(): string { return 'Production Line Count'; } }