dependent select in AttachAction syntax?
I am trying the following: Inside
RecipeResource:
ProductRelationsManager:
->headerActions([
AttachAction::make()
->modalHeading('Add Product')
->modalDescription('Add Product')
->modalSubmitActionLabel('Add')
->attachAnother(false)
->preloadRecordSelect()
->label('Add Product')
->form(fn (AttachAction $action): array => [
Forms\Components\Select::make('category_id')
->placeholder('Select Product Category')
->searchable()
->columnSpan(1)
->live()
->options($product_categories)
->required(),
$action->getRecordSelect(fn (Get $get): Collection => Product::query()
->where('category_id', $get('category_id'))
->pluck('name', 'id')),
1 Reply
Solution
solved it