Forms\Components\Select::make('union_id')
->label(__('labels.union'))
->options(function (): array {
$union = Union::find(auth()->user()->location[0]);
return [
$union->id => $union->name_bn
];
})
->suffixAction(
Forms\Components\Actions\Action::make("select_union")
->icon('heroicon-o-plus')
->modalHeading(__('labels.select_union'))
->form(self::locationForm())
->modalCancelAction(false)
->modalSubmitActionLabel(__('labels.select'))
->action(function (Set $set, $state, array $data, Component $component) {
$union = Union::find($data['union']);
$component->options([
$union->id => $union->name_bn
]);
$set('union_id', $union->id);
}),
)
Forms\Components\Select::make('union_id')
->label(__('labels.union'))
->options(function (): array {
$union = Union::find(auth()->user()->location[0]);
return [
$union->id => $union->name_bn
];
})
->suffixAction(
Forms\Components\Actions\Action::make("select_union")
->icon('heroicon-o-plus')
->modalHeading(__('labels.select_union'))
->form(self::locationForm())
->modalCancelAction(false)
->modalSubmitActionLabel(__('labels.select'))
->action(function (Set $set, $state, array $data, Component $component) {
$union = Union::find($data['union']);
$component->options([
$union->id => $union->name_bn
]);
$set('union_id', $union->id);
}),
)