Current state in Select field

Hi, I am trying to disable a field while another field is not set.

Forms\Components\Select::make('room_id')
                    ->label(__('Zimmer'))
                    ->relationship('room')
                    ->required()
                    ->searchable()
                    ->preload()
                    ->disabled(fn(array $state) => ...),


but array $state is not working since it's injected with null and that's wrong. πŸ˜…
Was this page helpful?