Skip to content

Commit

Permalink
tweak config name
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 7, 2016
1 parent 051f3c8 commit dcff158
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/Illuminate/Filesystem/FilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,16 @@ public function url($path)

return $adapter->getClient()->getObjectUrl($adapter->getBucket(), $path);
} elseif ($adapter instanceof LocalAdapter) {
$flysystemConfig = $this->driver->getConfig();
$config = $this->driver->getConfig();

if ($flysystemConfig->has('url_root')) {
return $flysystemConfig->get('url_root').'/'.$path;
if ($config->has('url')) {
return $config->get('url').'/'.$path;
}

$path = '/storage/'.$path;

return Str::contains($path, '/storage/public') ? Str::replaceFirst('/public', '', $path) : $path;
return Str::contains($path, '/storage/public') ?
Str::replaceFirst('/public', '', $path) : $path;
} else {
throw new RuntimeException('This driver does not support retrieving URLs.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Filesystem/FilesystemManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ protected function getRackspaceContainer(Rackspace $client, array $config)
*/
protected function createFlysystem(AdapterInterface $adapter, array $config)
{
$config = Arr::only($config, ['visibility', 'disable_asserts', 'url_root']);
$config = Arr::only($config, ['visibility', 'disable_asserts', 'url']);

return new Flysystem($adapter, count($config) > 0 ? $config : null);
}
Expand Down

0 comments on commit dcff158

Please sign in to comment.