Support the ongoing development of Laravel.io →
posted 9 years ago
Views
Last updated 1 year ago.
0

The public_path() function does not intend to be use to serve browser friendly uri, so you're right, you should use url('/') instead.

Last updated 1 year ago.
0

It returns the absolute path because you might need some way to return that path if you're handling files on the server that can also be accessed publicly...something like PDFs. As codextends said, just use the url helper.

Last updated 1 year ago.
0

Okay thanks! I wasn't really aware of it.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.