handle($request->validated()); return (new LoanProcessResource($loan))->response()->setStatusCode(201); } public function process(string $loanId, ProcessLoanAction $processLoan): JsonResponse { return (new LoanProcessResource($processLoan->handle($loanId)))->response(); } public function show(string $loanId, GetLoanAction $getLoan): JsonResponse { return (new LoanResource($getLoan->handle($loanId)))->response(); } public function history(string $loanId, GetLoanHistoryAction $getLoanHistory): AnonymousResourceCollection { return LoanHistoryResource::collection($getLoanHistory->handle($loanId)); } }