Installation
How to install Laravel?

Open CMD Command prompt to Laravel Instllation Command
 
composer create-project laravel/laravel your-project-name version

Note : Where version is not mandatory, and your-project-name so that this will be a your project folder.

Directory Structure of Laravel5.4

 

The root directory of Laravel contains various folders and files as shown in the above picture.

app - In this directory we create core code of the application like create Controller and Middleware inside Http Directory, and Models etc.

bootstrap - This directory contains the application bootstrapping script.

config - This directory contains configuration files of application.

database - This folder contains your database migration and seeds.

public - This is the applications document root. It starts the Laravel application. It also contains the assets of the application like JavaScript, CSS, Images, etc.

resources - This directory contains raw assets such as the LESS & Sass files, localization and language files, and Templates that are rendered as HTML.

storage - In this directory contain all logs, session, file uploads,cache etc that is use for when Laravel is running, For this purpose this directory contain three folder that is app, framework and Logs

test - This directory contains various test cases.

vendor - All Dependencies of laravel store in vendor folder, suppose we want to install third party package so for this all dependencies regarding this third party package will install in vendor folder

PHP artisan

We interact laravel by command-line by using Artisan command, for example create controller, create model, This are number of commands that help us to create laravel application easily.

For example

php artisan list
php artisan help
php artisan tinker
php artisan make
php artisan versian

Examples
To create Model - php artisan make model model_name
To create Controller - php artisan make controller controller_name

Environment Configuration

Environment variable provide a list of web services for your application, all these variables are declared in .env file, this file available in root folder

By default .env file has following variable

APP_ENV = local
APP_DEBUG = true
APP_KEY = Key
APP_URL = http://localhost
DB_CONNECTION = mysql
DB_HOST = 127.0.0.1
DB_PORT = 3306
DB_DATABASE = homestead
DB_USERNAME = homestead
DB_PASSWORD = secret
CACHE_DRIVER = file
SESSION_DRIVER = file
QUEUE_DRIVER = sync
REDIS_HOST = 127.0.0.1
REDIS_PASSWORD = null
REDIS_PORT = 6379
MAIL_DRIVER = smtp
MAIL_HOST = mailtrap.io
MAIL_PORT = 2525
MAIL_USERNAME = null
MAIL_PASSWORD = null
MAIL_ENCRYPTION = null

Previous
Next