Laravel paths explained

For the reference because I tend to forget things sometimes.

// project's root folder    
echo base_path();

// 'app' folder    
echo app_path();        

// 'public' folder but inside app folder and not /home/admin/web/domain.com/public_html
echo public_path();

// 'storage' folder    
echo storage_path();

// 'storage/app' folder    
echo storage_path('app');

Leave a Reply

Your email address will not be published. Required fields are marked *