middleware('auth:sanctum'); } protected function run(Request $request): JsonResponse { $customer = Customer::getSelf(); if (!$customer->canPayByCreditcard()) { return $this->failedResponse(); } $application = new ChangePaymentMethodCreditcardOrderApplication(); $manager = new GeneralApplicationManager($application); $manager ->setCustomer($customer) ->makeApplication(); $application->save(); return $this->successResponse(); } }