FilamentF
Filament10mo ago
GizaRex

Custom widget action steps

So I created an custom widget so that an user knows if he should pay this year or not. With the ->url() it redirect correct. But know I want to do it with steps>
When I use the steps nothing happens when I click on the button.

  • When I don't implement the interfaces I this error Public method [mountAction] not found on component.
    • When I implement the interfaces nothing happens when I click on the pay button. No error in the console. Just the loading spinner on the button and that's it.
What am I doing wrong?

My widget:
 public function payNow(): Action
    {
        return Action::make('Pay Now')
            ->label('Betalen')
            ->color('danger')
            ->steps([
                Step::make('payment')
                    ->label('Betaling')
                    ->schema([
                        Select::make('subscription')
                            ->label('Abonnement')
                            ->options(Membership::whereHas('season', fn($query) => $query->current())
                                ->pluck('name', 'id'))
                            ->required(),
                    ]),
                Step::make('payment-method')
                    ->label('Betaalmethode')
                    ->schema([
                        Select::make('payment_method')
                            ->label('Betaalmethode')
                            ->options([
                                'credit_card' => 'Credit Card',
                                'bancontact' => 'Bancontact',
                                'paypal' => 'PayPal',
                            ])
                            ->required(),
                    ]),
            ]);
    }
Solution
Fixed with: Action::make('payNow) instead of Action::make('Pay Now)
Was this page helpful?