Path Helpers
Available Methods
Method Listing
app_path()
The app_path
function returns the fully qualified path to the app
directory. You may also use the app_path
function to generate a fully qualified path to a file relative to the application directory:
$path = app_path();
$path = app_path('Http/Controllers/Controller.php');
base_path()
The base_path
function returns the fully qualified path to the project root. You may also use the base_path
function to generate a fully qualified path to a given file relative to the project root directory:
$path = base_path();
$path = base_path('vendor/bin');
config_path()
The config_path
function returns the fully qualified path to the application configuration directory:
$path = config_path();
database_path()
The database_path
function returns the fully qualified path to the application's database directory:
$path = database_path();
public_path()
The public_path
function returns the fully qualified path to the public
directory:
$path = public_path();
resource_path()
The resource_path
function returns the fully qualified path to the resources
directory. You may also use the resource_path
function to generate a fully qualified path to a given file relative to the resources directory:
$path = resource_path();
$path = resource_path('assets/sass/app.scss');
storage_path()
The storage_path
function returns the fully qualified path to the storage
directory. You may also use the storage_path
function to generate a fully qualified path to a given file relative to the storage directory:
$path = storage_path();
$path = storage_path('app/file.txt');