Skip to content
Readerstacks logo Readerstacks
  • Home
  • Softwares
  • Angular
  • Php
  • Laravel
  • Flutter
Readerstacks logo
Readerstacks
folder paths using helpers in laravel

How to get folder paths using helpers in laravel?

Aman Jain, August 27, 2021February 22, 2024

Laravel has helpers to get folder paths using helpers in laravel and by which we can easily get root folder, public folder, assets folder, storage folder, app folder etc.

Laravel has helpers to get the path of root folder, public folder, assets folder, storage folder, app folder.

To get the path of app folder we can use app_path() function in laravel which gives the path of app folder in laravel project.

app_path();
//we can pass parameters to app_path function

app_path("Http/Controllers");

Output will be:

var/www/html/app/Http/Controllers

To get the path of storage folder in laravel we can user storage_path() function which gives path of storage folder.

storage_path();
//we can pass parameters to storage_path() function

storage_path("app");

Output will be:

var/www/html/storage/app

To get the path of root folder in laravel we can user base_path() function which gives path of root folder.

base_path();
//we can pass parameters to base_path() function

base_path("app");

Output will be:

var/www/html/app

To get the path of public folder in laravel we can user public_path() function which gives path of public folder.

public_path();
//we can pass parameters to public_path() function

public_path("images");

Output will be:

var/www/html/public/images

To get the path of resource folder in laravel we can user resource_path() function which gives path of resource folder.

resource_path();
//we can pass parameters to resource_path() function

resource_path("layout");

Output will be:

var/www/html/resource/layout

To get the path of config folder in laravel we can user config_path() function which gives path of config folder.

config_path();
//we can pass parameters to resource_path() function

config_path("config.php");

Output will be:

var/www/html/config/config.php

Related

Laravel

Post navigation

Previous post
Next post

Related Posts

Php Laravel group by with example

How to use laravel group by with example ?

January 22, 2022January 22, 2022

MySQL group by is used to group same column value multiple rows into one row so to create the group by query we used groupBy method. laravel groupBy method accepts single and multiple parameter as column name. In this article i will show you to use groupBy in multiple ways,…

Read More
Php Facebook Login or Signup in laravel 8 9

How to Implement Facebook Login or Signup in laravel 8 / 9 ?

March 19, 2022March 19, 2022

Facebook login or signup in laravel are demanding from start as it gives user to access the website in single click. Facebook is widely used social media platform therefore most of the users are on it and we can take leverage of it by providing the feature of login and…

Read More
Php How to Permanent Delete Soft Deleted Records in Laravel 9

How to Permanent Delete Soft Deleted Records in Laravel 9 ?

June 18, 2022June 18, 2022

In this article we will learn to Permanent Delete soft deleted records in Laravel. In our recent article How to fetch Soft Deleted Records in Laravel 9 ? and How to Restore Soft Deleted Records in Laravel 9 we learnt to fetch the records from database and Restore the records…

Read More

Aman Jain
Aman Jain

With years of hands-on experience in the realm of web and mobile development, they have honed their skills in various technologies, including Laravel, PHP CodeIgniter, mobile app development, web app development, Flutter, React, JavaScript, Angular, Devops and so much more. Their proficiency extends to building robust REST APIs, AWS Code scaling, and optimization, ensuring that your applications run seamlessly on the cloud.

Categories

  • Angular
  • CSS
  • Dart
  • Devops
  • Flutter
  • HTML
  • Javascript
  • jQuery
  • Laravel
  • Laravel 10
  • Laravel 11
  • Laravel 9
  • Mysql
  • Php
  • Softwares
  • Ubuntu
  • Uncategorized

Archives

  • June 2025
  • May 2025
  • April 2025
  • October 2024
  • July 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • July 2023
  • March 2023
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Recent Posts

  • The Resilience of Nature: How Forests Recover After Fires
  • Understanding Laravel Cookie Consent for GDPR Compliance
  • Understanding High Vulnerabilities: A Critical Overview of the Week of May 12, 2025
  • Installing a LAMP Stack on Ubuntu: A Comprehensive Guide
  • Understanding High Vulnerabilities: A Deep Dive into Recent Security Concerns
©2023 Readerstacks | Design and Developed by Readerstacks
Go to mobile version