Learning & Integrating web technology and code help directory

Structure of a Laravel application

No comments

Structure of a Laravel application.

In the next two chapters, we will be installing Laravel and creating our first application. Any new project already has a complete directory tree and even some placeholder files to get you up and running in very little time. This structure is a great starting point, but as we will see in the final chapter of this book, it is also customizable. Here is what it looks like:

./app/
# Your Laravel application
./app/commands/
# - Command line scripts
./app/config/
# - Configuration files
./app/controllers/
# - Controllers
./app/database/
# - Database migrations and seeders
./app/lang/
# - Localisation variables
./app/models/
# - Classes used to represent entities
./app/start/
# - Startup scripts
./app/storage/
# - Cache and logs directory
./app/tests/
# - Test cases
./app/views/
# - Templates that are rendered to HTML
./app/filters.php
# - Filters executed before/after a request
./app/routes.php
# - URLs and actions
./bootstrap/
# Application bootstrapping scripts
./public/
# Document root
./public/.htaccess
# - Sends incoming requests to index.php
./public/index.php
# - Starts Laravel application
./vendor/
# Third-party dependencies installed

through Composer
./artisan*
# Artisan command line utility
./composer.json
# Project dependencies
./phpunit.xml
# Test configuration file for PHPUnit
./server.php
# Local development server
Like the rest of Laravel, the naming is expressive, and it is easy to guess what each folder is for. On the first level, there are four directories, app/, bootstrap/, public/, and vendor/. All your server-side code will reside in the app/ directory,
inside which you will find the three directories that hold the files for the controllers, models, and views. We will explore the responsibilities of each directory further in the next chapters.

No comments :

Post a Comment