How to get Laravel Application root path ?
Laravel

How to get Laravel Application root path ?

I hope you're having a fantastic day! Today, I'm thrilled to share valuable insights on accessing critical paths such as the application root path and storage path in Laravel versions 5 through 9.

Laravel simplifies path management with a variety of handy helper functions designed to streamline tasks like retrieving the app path, public path, storage path, and base path. Let's dive into the methods for effortlessly accessing these essential paths:

How to get a public path

public_path()
//you can access public folder via this helper

How to get the Storage path

storage_path()
//you can access storage folder via this helper method.

How to get the App path

app_path()
//you can access app folder using this helper.

How to get the Base path

base_path()

//you can access root of the application using this helper. You can travel any of the folder using this folder.

 

Hope, it will help you.

Get The latest Coding solutions.

Subscribe to the Email Newsletter