Project Structure
Laravel’s source package contains a number of different directories. Let’s take a look at the
project structure to gain a greater understanding of how things work. I may use some terms to
describe various features of Laravel that could be confusing if you are just starting out, if so,
bear with me as we will cover each feature in more detail in a later chapter.
2.1 Root Directory Structure
Lets take a quick look at the top-level file and directory structure :
1 /application
2 /bundles
3 /laravel
4 /public
5 /storage
6 /vendor
7 /artisan [file]
8 /paths.php [file]
Now lets take a closer look at each item :
/application
This is where the majority of the code for your application will live. It contains your routing,
data models and views. You will be spending most of your time here!
/bundles
Bundles are Laravel applications. They can be used to separate aspects of your application, or
can be released / downloaded to share common code¹. By installing new bundles with artisan,
you can extend the functionality of Laravel to suit your needs.
Interestingly, the /application directory is also a bundle known as the DEFAULT_BUNDLE,
this means that anything you use in /application you can also use in your bundles!
/laravel
This is where the framework’s core files live. These are the files it needs to execute a request.
You will rarely have to interact with this directory, but it can sometimes be useful to browse the
source to see how a Class or Method works. Alternatively you could check the Laravel API².
/public
This is the directory that you must point your web server to. It contains the bootstrap file
index.php which starts the Laravel framework and the routing process. The public directory
can also be used to hold any publicly accessible assets such as CSS, Javascript files and images.