<?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(),