Radio::make('access_option')
->default('specific')
->options([
'all' => 'All Locations',
'specific' => 'Specific locations',
'copy' => 'Copy location access from user',
'team' => 'Add all from specific team'
])
->required()
->live()
->afterStateUpdated(fn (Radio $component) => $component
->getContainer()
->getComponent('dynamicTypeFields')
->getChildComponentContainer()
->fill()),
Grid::make(2)
->schema(fn (Get $get): array => match ($get('access_option')) {
...
})->key('dynamicTypeFields')
Radio::make('access_option')
->default('specific')
->options([
'all' => 'All Locations',
'specific' => 'Specific locations',
'copy' => 'Copy location access from user',
'team' => 'Add all from specific team'
])
->required()
->live()
->afterStateUpdated(fn (Radio $component) => $component
->getContainer()
->getComponent('dynamicTypeFields')
->getChildComponentContainer()
->fill()),
Grid::make(2)
->schema(fn (Get $get): array => match ($get('access_option')) {
...
})->key('dynamicTypeFields')