{"record":{"id":"cf2dacfd64dd7edb","repo":"laravel/framework","slug":"this-driver-does-not-support-retrieving-urls","errorCode":null,"errorMessage":"This driver does not support retrieving URLs.","messagePattern":"This driver does not support retrieving URLs\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Filesystem/FilesystemAdapter.php","lineNumber":797,"sourceCode":"     */\n    public function url($path)\n    {\n        if (isset($this->config['prefix'])) {\n            $path = $this->concatPathToUrl($this->config['prefix'], $path);\n        }\n\n        $adapter = $this->adapter;\n\n        if (method_exists($adapter, 'getUrl')) {\n            return $adapter->getUrl($path);\n        } elseif (method_exists($this->driver, 'getUrl')) {\n            return $this->driver->getUrl($path);\n        } elseif ($adapter instanceof FtpAdapter || $adapter instanceof SftpAdapter) {\n            return $this->getFtpUrl($path);\n        } elseif ($adapter instanceof LocalAdapter) {\n            return $this->getLocalUrl($path);\n        } else {\n            throw new RuntimeException('This driver does not support retrieving URLs.');\n        }\n    }\n\n    /**\n     * Get the URL for the file at the given path.\n     *\n     * @param  string  $path\n     * @return string\n     */\n    protected function getFtpUrl($path)\n    {\n        return isset($this->config['url'])\n            ? $this->concatPathToUrl($this->config['url'], $path)\n            : $path;\n    }\n\n    /**\n     * Get the URL for the file at the given path.","sourceCodeStart":779,"sourceCodeEnd":815,"githubUrl":"https://github.com/laravel/framework/blob/e0f6eb3518ac29fbbca8529e97d0df7fc9f24481/src/Illuminate/Filesystem/FilesystemAdapter.php#L779-L815","documentation":"Thrown by FilesystemAdapter::url() when none of the URL-resolution branches succeed: the underlying adapter has no getUrl() method, the driver has no getUrl(), and the adapter is neither FtpAdapter/SftpAdapter nor LocalAdapter. The configured disk simply cannot synthesize a public URL for a stored object.","triggerScenarios":"Calling Storage::disk($name)->url($path) on a disk whose driver does not advertise URLs — e.g., an Amazon S3 v2 adapter without a 'url'/'endpoint' config, an in-memory adapter, a custom driver that does not implement getUrl().","commonSituations":"Missing 'url' key in config/filesystems.php for an S3 disk; using a local-style disk on a custom adapter without implementing getUrl; switch from league/flysystem-aws-webda… adapters; calling url() on a disk that should have used temporaryUrl() instead.","solutions":["For S3/public clouds, set the 'url' (and 'bucket_endpoint'/'endpoint') in the disk config so the adapter builds URLs.","Implement getUrl() on a custom adapter, or register a URL via Storage::disk()->build() with a URL-aware adapter.","For local disks ensure the driver resolves to LocalAdapter and 'url' is configured.","Use temporaryUrl() if you need time-limited access instead of a permanent URL."],"exampleFix":"// before\nStorage::disk('s3')->url($path); // throws\n\n// after: config/filesystems.php\n's3' => [\n    'driver' => 's3',\n    'key' => env('AWS_ACCESS_KEY_ID'),\n    'secret' => env('AWS_SECRET_ACCESS_KEY'),\n    'region' => env('AWS_DEFAULT_REGION'),\n    'bucket' => env('AWS_BUCKET'),\n    'url' => env('AWS_URL'),\n]","handlingStrategy":"validation","validationCode":"if (empty(config(\"filesystems.disks.{$name}.url\")) && ! in_array(config(\"filesystems.disks.{$name}.driver\"), ['local','ftp','sftp'], true)) {\n    throw new RuntimeException(\"Disk [{$name}] cannot resolve URLs; set 'url' in config.\");\n}\nStorage::disk($name)->url($path);","typeGuard":"function diskSupportsUrl(string $name): bool {\n    $driver = config(\"filesystems.disks.{$name}.driver\");\n    return method_exists(Storage::disk($name)->getAdapter(), 'getUrl')\n        || in_array($driver, ['local','ftp','sftp'], true);\n}","tryCatchPattern":"try {\n    $url = Storage::disk($name)->url($path);\n} catch (\\RuntimeException $e) {\n    report($e);\n    $url = null;\n}","preventionTips":["Set 'url' on cloud disks in filesystems.php.","Use local or S3 adapters when URLs are required.","Implement getUrl() on custom adapters.","Prefer temporaryUrl() for protected assets."],"tags":["filesystem","cloud","url","s3","driver"],"backgroundTag":null,"analyzedSha":"e0f6eb3518ac29fbbca8529e97d0df7fc9f24481","analyzedAt":"2026-08-11T20:52:37.562Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}