06.10.2016 Views

laravel-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Application Structure<br />

• Introduction<br />

• The Root Directory<br />

• The App Directory<br />

Introduction<br />

The default Laravel application structure is intended to provide a great starting point for both<br />

large and small applications. Of course, you are free to organize your application however you like.<br />

Laravel imposes almost no restrictions on where any given class is located - as long as Composer<br />

can autoload the class.<br />

The Root Directory<br />

The root directory of a fresh Laravel installation contains a variety of directories:<br />

The app directory, as you might expect, contains the core code of your application. We’ll explore<br />

this directory in more detail soon.<br />

The bootstrap directory contains a few files that bootstrap the framework and configure autoloading,<br />

as well as a cache directory that contains a few framework generated files for bootstrap<br />

performance optimization.<br />

The config directory, as the name implies, contains all of your application’s configuration files.<br />

The database directory contains your database migration and seeds. If you wish, you may also use<br />

this directory to hold an SQLite database.<br />

The public directory contains the front controller and your assets (images, JavaScript, CSS, etc.).<br />

The resources directory contains your views, raw assets (LESS, SASS, CoffeeScript), and localization<br />

files.<br />

The storage directory contains compiled Blade templates, file based sessions, file caches, and<br />

other files generated by the framework. This directory is segregated into app, framework, and<br />

logs directories. The app directory may be used to store any files utilized by your application.<br />

The framework directory is used to store framework generated files and caches. Finally, the logs<br />

directory contains your application’s log files.<br />

185

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!