with(['loanType', 'currentStep.stageDefinition']) ->where('public_id', $loanId) ->first(); if ($loan === null) { throw new LoanNotFoundException("Loan {$loanId} was not found."); } return $loan; } }