{"record":{"id":"eb659a9cc068637f","repo":"laravel/framework","slug":"this-driver-does-not-support-creating-temporary-ur","errorCode":null,"errorMessage":"This driver does not support creating temporary URLs.","messagePattern":"This driver does not support creating temporary URLs\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Filesystem/FilesystemAdapter.php","lineNumber":883,"sourceCode":"     * @param  \\DateTimeInterface  $expiration\n     * @param  array  $options\n     * @return string\n     *\n     * @throws \\RuntimeException\n     */\n    public function temporaryUrl($path, $expiration, array $options = [])\n    {\n        if (method_exists($this->adapter, 'getTemporaryUrl')) {\n            return $this->adapter->getTemporaryUrl($path, $expiration, $options);\n        }\n\n        if ($this->temporaryUrlCallback) {\n            return $this->temporaryUrlCallback->bindTo($this, static::class)(\n                $path, $expiration, $options\n            );\n        }\n\n        throw new RuntimeException('This driver does not support creating temporary URLs.');\n    }\n\n    /**\n     * Get a temporary upload URL for the file at the given path.\n     *\n     * @param  string  $path\n     * @param  \\DateTimeInterface  $expiration\n     * @param  array  $options\n     * @return array\n     *\n     * @throws \\RuntimeException\n     */\n    public function temporaryUploadUrl($path, $expiration, array $options = [])\n    {\n        if (method_exists($this->adapter, 'temporaryUploadUrl')) {\n            return $this->adapter->temporaryUploadUrl($path, $expiration, $options);\n        }\n","sourceCodeStart":865,"sourceCodeEnd":901,"githubUrl":"https://github.com/laravel/framework/blob/e0f6eb3518ac29fbbca8529e97d0df7fc9f24481/src/Illuminate/Filesystem/FilesystemAdapter.php#L865-L901","documentation":"Thrown by FilesystemAdapter::temporaryUrl() when the adapter exposes no getTemporaryUrl() method and no custom temporaryUrlCallback is registered. Temporary (pre-signed) URLs are only meaningful for drivers that support signed access (S3, R2, GCS, etc.); the local driver does not, by default.","triggerScenarios":"Calling Storage::disk($name)->temporaryUrl($path, $expiration) on a disk that does not support pre-signed URLs — e.g., the 'local' driver, or a custom driver without getTemporaryUrl() and without a registered callback.","commonSituations":"Using the local disk in non-production then deploying to S3 without swapping; custom adapter that forgot getTemporaryUrl(); Azure/AWS SDK downgrade that removed the method; calling temporaryUrl() where url() was intended.","solutions":["Switch to an S3 (or other pre-sign-capable) disk for assets that need temporary URLs.","Register a custom generator: Storage::disk($name)->buildTemporaryUrlsUsing(function ($path, $expiration, $options) { ... }).","If running locally, configure a callback that serves files through a signed route instead.","Verify the adapter package version exposes getTemporaryUrl() (e.g., league/flysystem-aws-s3-v3)."],"exampleFix":"// before\nStorage::disk('local')->temporaryUrl($path, now()->addMinutes(5));\n\n// after: register a custom resolver\nStorage::disk('local')->buildTemporaryUrlsUsing(\n    fn ($path, $expiration, $options) => URL::temporarySignedRoute('files.show', $expiration, ['path' => $path])\n);","handlingStrategy":"fallback","validationCode":"if (! method_exists(Storage::disk($name)->getAdapter(), 'getTemporaryUrl')\n    && empty($disk->getTemporaryUrlCallback())) {\n    throw new RuntimeException(\"Disk [{$name}] cannot create temporary URLs.\");\n}","typeGuard":"function diskSupportsTemporaryUrl(string $name): bool {\n    return method_exists(Storage::disk($name)->getAdapter(), 'getTemporaryUrl');\n}","tryCatchPattern":"try {\n    $url = Storage::disk($name)->temporaryUrl($path, $expiration);\n} catch (\\RuntimeException $e) {\n    // fall back to a signed application route\n    $url = URL::temporarySignedRoute('files.show', $expiration, ['path' => $path]);\n}","preventionTips":["Use S3 (or compatible) disks for pre-signed URLs.","Register buildTemporaryUrlsUsing() for local disks.","Document which disks support temporary URLs.","Test pre-signing in the target environment."],"tags":["filesystem","temporary-url","presigned","s3","driver"],"backgroundTag":null,"analyzedSha":"e0f6eb3518ac29fbbca8529e97d0df7fc9f24481","analyzedAt":"2026-08-11T20:52:37.562Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}