Laravel 4.2 directory structure


When you first learn about laravel you need to understand the directory structure of laravel, this article i will explain little bit about directory structure in laravel 4.2, this tutorial is for beginners learning about laravel 4.2.

app/commands/
The app/commands is for storing your own php artisan command, you can create your own artisan command and placed under this folder. For more info on how to create your own artisan command, read my other article here.

app/config/
In laravel 4.2 all configuration files lives under app/config folder, you can see the database.php for database configuration, mail.php for email and so on.

app/controllers/
In laravel 4.2, you can create a controller class and put it under app/controllers/, you can also create another folder inside app/controllers/ and put the controller class in there.

app/database/
The app/database is where your database migration and seeder lives, every time you create migration it will be stored inside app/database folder.

app/lang/
The app/lang/ is where you define the language translation if you want to create multi language application, the default there is only one language which is 'en' for english, but you can create another language such as 'ru' for russia or 'jp' for japan and so on.

app/models/
The app/models is where you put your model in laravel 4.2, every tables should have it's own model, so you can use it with eloquent.

app/start/
This folder is not important specially if you are beginner, no need to worry about this folder.

app/storage/
The app/storage is where the application cache, logs, and session stored, the laravel.log also lives under this folder, app/storage/logs/laravel.log to be exact.

app/tests/
The app/tests is where you put your unit test file (phpunit).

app/views/
The app/views is where you put your laravel view, whether it's a blade or php template, all views in laravel 4.2 lives under app/views.

app/routes.php
The app/routes.php is your laravel 4.2 routing file, put every route on this file.

public/
The public folder is where you put your static files, such as image, css, javascript, etc, you can summon these files on your views.

2 comments

Thank you for sharing this informative post. looking forward to read more.
Laravel Web Development Services

Thanks for sharing this informative article on PHP Laravel framework. If you have any requirement to Hire Laravel Developers on remote for your project. Please contact us.


EmoticonEmoticon