! $resource->paid && $resource->status === OrderRepo::PENDING; } /** * Perform the action on the given models. * * @param ActionFields $fields * @param Collection $models * @return mixed */ public function handle(ActionFields $fields, Collection $models): mixed { $resource = $models->first(); $payment = (new OnlinePaymentRepo)->payCardOrder($resource); return $payment['status'] === 'success' ? ActionResponse::openInNewTab($payment['url']) : ActionResponse::danger('Тöleg sistemada registrasiýa bolmady!'); } /** * Get the fields available on the action. * * @return array */ public function fields(NovaRequest $request): array { return []; } }