What is Laravel?
Laravel is a PHP based web-framework for building high-end web applications using its significant and graceful syntaxes.
It comes with a strong collection of tools and provides application architecture.
It includes various characteristics of technologies like ASP.NET MVC, CodeIgniter, Ruby on Rails and lot more.
This framework is an open source framework.
It facilitates developers by saving huge time and helps reduce the thinking and planning to develop the entire website from scratch.
Laravel was developed by Taylor Otwell in July 2011 and it was released more than five years after the release of the Codeigniter.
Laravel is a PHP based web-framework like Codeigniter.
Laravel is one of the open source PHP frameworks.
Laravel follows the model-view-controller (MVC) architectural pattern.
Laravel is one of the most popular PHP frameworks after Codeigniter.
Features of Laravel:
Authentication and authorization of users
ORM (Object Relational Mapper) features
Provides template engine
What does laravel do?
Models & DB migrations
Views / Templates
Storage & File Management
Email & Config
What is a composer?
Laravel implements composer for managing dependencies
URL to download composer
How to setup Laravel?
download the installer of Laravel with the help of Composer
composer global require "laravel/installer"
Laravel includes the Artisan CLI Commands:
Creating controllers & models
Creating database migration files and running migrations
Create providers events jobs form requests, etc.
Create custom commands
Examples of Artisan Commands:
$ php artisan list
$ php artisan help migrate
$ php artisan make:controller CrudController
$ php artisan make:model Crud-m
$ php artisan make:migration add_crud_to_db-table=crud
$ php artisan migrate
$ php artisan tinker
Laravel includes the eloquent object relational mapper
=> Makes querying & working with the DB very easy
=> We can still use row SQL queries if needed
$crud = new crud;
$crud->title = “New Crud”;
Blade Template Engine:
Simple and powerful
Control structure (if else, loops, etc)
Can you use <?php echo ‘php tags’; ?>
Template Inheritance : Extends layouts easily.
Can create custom components
<!-- stored in resources/views/layouts/app.blade.php -->
<title> App Name - @yield(‘title‘) </title>
This is the maser sidebar
<!-- stored in resources/views/layouts/child.blade.php -->
@section(‘title’, ‘page title’)
<p>this is appended to the master sidebar</p>
<p>this is my body content</p>
How to Install laravel app
->>> composer create-project laravel/laravel crudapp
how to Make controller in Laravel
->>> migrate database
Run laravel app
->>> php artisan serve
Mirate Table into Database
->>> php artisan migrate
Command to find laravel version
->>> php artisan --version
The root directory structure of laravel