Forms\Components\CheckboxList::make('teams')
->options(fn(Forms\Get $get): Collection => $get('organisation_id') ?
Team::whereHas('organisations', function ($subquery) use ($get) {
$subquery->where('id', $get('organisation_id'));
})->pluck('name', 'id') :
collect([]))
Forms\Components\CheckboxList::make('teams')
->options(fn(Forms\Get $get): Collection => $get('organisation_id') ?
Team::whereHas('organisations', function ($subquery) use ($get) {
$subquery->where('id', $get('organisation_id'));
})->pluck('name', 'id') :
collect([]))