FilamentF
Filament3y ago
Abi

action method not working on a standalone Action

I have the following code and the action method doesn't get executed.
Action::make('addToCart')
            ->label('ADD PLAYERS TO CART')
            ->modalHeading('Add Players to Cart')
            ->modalWidth('2xl')
            ->modalSubmitActionLabel('Add Players to Cart')
            ->modalFooterActionsAlignment('end')
            ->form([
                Select::make('existing_kids')
                    ->label('Select existing kids information previously added')
                    ->required()
                    ->multiple()->options($this->getFamilyMembers()),
            ])->action(fn($data) => function () {
                ray($this->form->getState());
            });

and the blade content is the following
{{ ($this->addToCartAction)(['productId'=>$item->id])}}
Was this page helpful?