Laravel 8 , Laravel 7 , Laravel , Laravel 6
Today now in this post i will show you How to get path from laravel 8 application root? We are know that laravel provide us several helper to get the path of public directory, app directory, storage directory and also base directory.
So it will help us to store the files, read file from the path and also for other from controller, view files, model etc.
Now we can see in the bellow how to get path of that directory by using helper one by one.
How to get base path(Project Root) in laravel ?
base_path(); // Path of application root
How to get public folder path in laravel ?
public_path(); // Path of public/
How to get app folder path in laravel ?
app_path(); // Path of app/
How to get storage folder path in laravel ?
storage_path(); // Path of storage/
I hope it help you...