Skip to content
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

[5.4] Add path method to get the full path of the given file #20395

Merged
merged 1 commit into from
Aug 2, 2017
Merged

[5.4] Add path method to get the full path of the given file #20395

merged 1 commit into from
Aug 2, 2017

Conversation

themsaid
Copy link
Member

@themsaid themsaid commented Aug 2, 2017

For example:

response()->download(Storage::disk('local')->path('file.txt'));

Currently you could use the url() method:

response()->download(Storage::disk('local')->url('file.txt'));

But when you use Storage::Fake() the return value of url() will be a non-existing file thus response->download() will error.

@miscbits
Copy link
Contributor

miscbits commented Aug 2, 2017

Should the method be called realPath instead of path? Looks like its returning the full file path and not a relative one.

@taylorotwell taylorotwell merged commit 9efaf00 into laravel:5.4 Aug 2, 2017
@decadence
Copy link
Contributor

Finally. I don't believe it doesn't exist in 2017 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants