Support the ongoing development of Laravel.io →
posted 8 years ago
Views
Last updated 5 months 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 5 months 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 5 months ago.
0

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

Last updated 5 months ago.
0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.