Select Form component not resetting value on change from different field

<?php

Forms\Components\Select::make('vehicle_id')
->label(__('drives.columns.vehicle'))
->placeholder('Izaberite Vozilo')
->options(fn (Get $get) => Vehicle::whereType($get('vehicle_type'))->pluck('licence_plate', 'id'))
->required()
->reactive()
->preload()
->live(onBlur: true)
->native(false),


Forms\Components\ToggleButtons::make('vehicle_type')
->label(__('drives.columns.vehicle_type'))
->options(VehicleType::class)
->afterStateUpdated(fn (Set $set) => $set('vehicle_id', null))
->required(),
<?php

Forms\Components\Select::make('vehicle_id')
->label(__('drives.columns.vehicle'))
->placeholder('Izaberite Vozilo')
->options(fn (Get $get) => Vehicle::whereType($get('vehicle_type'))->pluck('licence_plate', 'id'))
->required()
->reactive()
->preload()
->live(onBlur: true)
->native(false),


Forms\Components\ToggleButtons::make('vehicle_type')
->label(__('drives.columns.vehicle_type'))
->options(VehicleType::class)
->afterStateUpdated(fn (Set $set) => $set('vehicle_id', null))
->required(),
Picture: If I click on Tip vozila (vehicle type) currently active is Kombi (Van) and if I click on Auto (car) I want to clear Vozilo (Vehicle) select field
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server