label(__('Pay')) ->icon('heroicon-o-credit-card') ->requiresConfirmation() ->action(function (CardOrder $record) { $onlinePayment = CardOrderRepository::make() ->createOnlinePaymentOrder($record); if ($onlinePayment->successful()) { Notification::make() ->success() ->title('Sending') ->send(); return redirect()->away($onlinePayment->paymentLink()); } Notification::make() ->danger() ->title('Could not send') ->send(); }); } }