diff --git a/src/Illuminate/Contracts/Foundation/Application.php b/src/Illuminate/Contracts/Foundation/Application.php index 74af47c751cb..e4a0bc20cd6c 100644 --- a/src/Illuminate/Contracts/Foundation/Application.php +++ b/src/Illuminate/Contracts/Foundation/Application.php @@ -56,9 +56,10 @@ public function resourcePath($path = ''); /** * Get the path to the storage directory. * + * @param string $path * @return string */ - public function storagePath(); + public function storagePath($path = ''); /** * Get or check the current application environment. diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 83b4886f09f3..c400e55861e5 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -454,11 +454,13 @@ public function publicPath() /** * Get the path to the storage directory. * + * @param string $path * @return string */ - public function storagePath() + public function storagePath($path = '') { - return $this->storagePath ?: $this->basePath.DIRECTORY_SEPARATOR.'storage'; + return ($this->storagePath ?: $this->basePath.DIRECTORY_SEPARATOR.'storage') + .($path ? DIRECTORY_SEPARATOR.$path : ''); } /** diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index bd879a8f6d61..7e0bdd1c3663 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -800,7 +800,7 @@ function session($key = null, $default = null) */ function storage_path($path = '') { - return app('path.storage').($path ? DIRECTORY_SEPARATOR.$path : $path); + return app()->storagePath($path); } }