8000 [9.x] Fix \Illuminate\Support\Facades\App::storagePath() method ignores $path argument by afilippov1985 · Pull Request #39648 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[9.x] Fix \Illuminate\Support\Facades\App::storagePath() method ignores $path argument #39648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add $path argument to storagePath()
  • Loading branch information
afilippov1985 committed Nov 17, 2021
commit 3382da1878be2df112c2f39ef0100870bad3110c
6 changes: 4 additions & 2 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
0