-
Notifications
You must be signed in to change notification settings - Fork 146
Method getUrl is not working #3
Comments
I'm having the same problem. +1
|
The method is obfuscated but you can access it like this: |
I haven't had a chance to look into this yet. What magic is Laravel doing here (https://laravel.com/docs/5.3/filesystem#file-urls) to check if the adapter is able to provide a url? |
I have the same problem, but I'm using Laravel 5.2. |
This seems to be a documentation issue. Laravel's storage facade resolves to an instance of a /**
* Get the URL for the file at the given path.
*
* @param string $path
* @return string
*/
public function url($path)
{
$adapter = $this->driver->getAdapter();
if (method_exists($adapter, 'getUrl')) {
return $adapter->getUrl($path);
} elseif ($adapter instanceof AwsS3Adapter) {
$path = $adapter->getPathPrefix().$path;
return $adapter->getClient()->getObjectUrl($adapter->getBucket(), $path);
} elseif ($adapter instanceof LocalAdapter) {
$path = '/storage/'.$path;
return Str::contains($path, '/storage/public') ? Str::replaceFirst('/public', '', $path) : $path;
} else {
throw new RuntimeException('This driver does not support retrieving URLs.');
}
} It checks if the adapter, in this case, Can you please try This is working for me.
|
Just stumbled upon this error:
I can correctly upload files (i found it in the firebase storage console) but when invoking the getUrl method here it is what I see:
This is the simple code I'm using in a controller
it seems the $disk doesn't have the getUrl Method.
I made a test in the GoogleCloudStorageServiceProvider.php file and here:
the $adapter has the getUrl method, but the constructor new Filesystem($adapter) returns an object without that method.
Am I missing something?
The text was updated successfully, but these errors were encountered: