Im using URL::base(); and I get this URL:
http://www.kp.com.mx/sis_colgate/public
but what I need is this complete path:
/home/belendez/public_html/sis_colgate/public
Does anybody knows how can I get that path? Thanks
The Root Directory Structure of LaravelThe app directory holds the base code for your Laravel application. The bootstrap directory contains all the bootstrapping scripts used for your application. The config directory holds all your project configuration files (. config).
1 - app_path() - The app_path function returns the fully qualified path to your application's app directory. 2 - base_path() - The base_path function returns the fully qualified path to your application's root directory.
./config/filesystems.Modify the section 'public' to change the 'root' value 'app/public' to your desired location, for example, app/public_html ( app is an alias of your root folder).
Laravel has helpers for paths:
base_path(); // '/var/www/mysite'
app_path(); // '/var/www/mysite/app'
storage_path(); // '/var/www/mysite/storage'
What you want to use is the path
helper.
The URL helper is for generating HTTP URLs.
Try the path('public')
function in Laravel 3,
or the public_path()
function in Laravel 4.
Edit: Updated with answer for Laravel 4, thanks Erin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With