{"record":{"id":"0465d9b27e8446cc","repo":"crater-invoice-inc/crater","slug":"link-expired","errorCode":null,"errorMessage":"Link Expired.","messagePattern":"Link Expired\\.","errorType":"http","errorClass":null,"httpStatus":403,"severity":"error","filePath":"app/Http/Controllers/V1/Customer/EstimatePdfController.php","lineNumber":44,"sourceCode":"                    $estimate->company_id\n                );\n\n                if ($notifyEstimateViewed == 'YES') {\n                    $data['estimate'] = Estimate::findOrFail($estimate->id)->toArray();\n                    $data['user'] = Customer::find($estimate->customer_id)->toArray();\n                    $notificationEmail = CompanySetting::getSetting(\n                        'notification_email',\n                        $estimate->company_id\n                    );\n\n                    \\Mail::to($notificationEmail)->send(new EstimateViewedMail($data));\n                }\n            }\n\n            return $estimate->getGeneratedPDFOrStream('estimate');\n        }\n\n        abort(403, 'Link Expired.');\n    }\n\n    public function getEstimate(EmailLog $emailLog)\n    {\n        $estimate = Estimate::find($emailLog->mailable_id);\n\n        return new EstimateResource($estimate);\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":54,"githubUrl":"https://github.com/crater-invoice-inc/crater/blob/05d5ce26fdd8d9466009163444e944259bc0cc2a/app/Http/Controllers/V1/Customer/EstimatePdfController.php#L26-L54","documentation":"The customer-side Estimate PDF endpoint aborts with HTTP 403 when the EmailLog record that carried the estimate link has passed its expiry window; the shared download link is no longer trusted, so the customer must request a fresh link from the company.","triggerScenarios":"Thrown at app/Http/Controllers/V1/Customer/EstimatePdfController.php:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check $emailLog->isExpired() before rendering and return a friendly 403/JSON error page pointing the user to request a new link","Regenerate the EmailLog (and its hash) by re-sending the estimate email so the customer gets a valid URL","Extend the expiry window in EmailLog if links are expiring too aggressively for the business workflow"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"05d5ce26fdd8d9466009163444e944259bc0cc2a","analyzedAt":"2026-09-13T09:14:24.260Z","contentChangedAt":"2026-09-13T09:14:24.260Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}