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.
About Laravel:
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:
Routing controllers
Configuration management
Testability
Authentication and authorization of users
Modularity
ORM (Object Relational Mapper) features
Provides template engine
Building schemas
E-mailing facilities
What does laravel do?
Route Handling
Security Layer
Models & DB migrations
Views / Templates
Authentication
Sessions
Compile assets
Storage & File Management
Error Handling
Unit Testing
Email & Config
Cache Handling
What is a composer?
Laravel implements composer for managing dependencies
URL to download composer
https://getcomposer.org/download/
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.
Show routes
Session commands
Run tinker
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
Eloquent ORM
Laravel includes the eloquent object relational mapper
=> Makes querying & working with the DB very easy
=> We can still use row SQL queries if needed
Use App/Crud
$crud = new crud;
$crud->title = “New Crud”;
$crud->save();
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 -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> App Name - @yield(‘title‘) </title>
</head>
<body>
@section(‘sidebar’)
This is the maser sidebar
$show
<div class=”container”>
@yield(‘content’)
</div>
</body>
</html>
<!-- stored in resources/views/layouts/child.blade.php -->
@extends(‘layouts.app’)
@section(‘title’, ‘page title’)
@section(‘sidebar’)
@parent
<p>this is appended to the master sidebar</p>
@endsection
@section(‘content’)
<p>this is my body content</p>
@endsection
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
0 Replies to “What Is Laravel? How To Install Laravel? PHP Based Laravel Framework”
Leave a Reply
Your email address will not be published.