SlideShare une entreprise Scribd logo
1  sur  24
INTRODUCTION TO LARAVEL
By
Awulonu Obinna
ABOUT THE SPEAKER
Developer and Web Admin @ Headquarters Nigerian Airforce
Twitter – https://www.twitter.com/awulonu_obinna
Facebook – https://www.facebook.com/awulonuobinna
GitHub – https://www.github.com/obinosteve
#phpenthusiast #laravelevangelist
What is Laravel?
Laravel is a free, open-sourcePHP web framework, used for
development of web applications following the model-view
controller (MVC) architectural pattern.
What is a Framework?
A framework is a piece of code which dictates the architecture your
project will follow. Once you choose a framework to work with, you
have to follow the framework's code and design methodologies. The
framework will provide you with hooks and callbacks, so that
you build on it - it will then call your plugged-in code whenever it
wishes, a phenomenon called Inversion of Control.
What is mvc?
The Model-View-Controller (MVC) is an architectural pattern
that provides a reusable solution to resolve common problems
that occurs while developing a Web application. It separates an
application into three main logical components: the model, view
and controller.
Model:
The model is responsible for managing the data of the application. It
responds to the request from the view and it also responds to
instructions from the controller to update itself.
View:
The View component is used for all the UI logic of the application.
The view includes all the UI components such as text boxes,
dropdowns, buttons, etc. that the final user interacts with.
Controller:
Controller is responsible for controlling the application logic and acts as the
coordinator between the View and the Model. The Controller receives input from
users via the View, then process the user's data with the help of Model and passing
the results back to the View.
Benefits of the MVC Pattern
 Separation of concerns: Enables you to ensure that various application concerns
into different and independent software components. Thus, it allows you to work on a
single component independently.
 Simplified testing and maintenance: Enables you to test each component
independently.
 Extensibility: Enables the model to include a set of independent components that you
can easily modify or replace based on the application requirement.
 Faster development process
 Ability to provide multiple views
 SEO friendly Development platform: It is very easy to develop SEO-friendly URLs to
generate more visits from a specific application.
Architecture of a Laravel Application
Did we miss anything? Routing?
What is Routing in Laravel ?
Routing
Routing defines how the application will process and respond to
incoming HTTP request. You can use URLs that properly describes the
controller action to which the request needs to be routed.
Routing enables use of URLs that are descriptive of the user actions
and are more easily understood by the users.
e.g Instead of http://myapplication/Users.php?id=1
we can
http://myapplication/Users/1
Letz Get Started
Environment Setup
 Laravel Homestead https://laravel.com/docs/5.5/homestead
 Laragon https://laragon.org/
 Method 3:
 Wamp server: http://www.wampserver.com/en/
 Composer: https://getcomposer.org/download/
 Nodejs: https://nodejs.org/en/
 Npm: Installed on your computer when you install Node.js
Create new Laravel Project
 From your command prompt or terminal or git bash, run:
composer create-project --prefer-dist laravel/laravel projectname
 Run your first laravel application:
php artisan serve
CONGRATULATIONS
You have successfully ran your first laravel app
Laravel Directory Structure
 App Directory: Contains the core code of your application. A variety of
other directories will be generated inside the app directory as you use
the make Artisan commands to generate classes.
 Bootstrap Directory: Contains the app.php file which bootstraps the
framework.
 Config Directory: Contains all of your application's configuration files.
 Database Directory: Contains your database migration and seeds.
 Public Directory: Contains the index.php file, which is the entry point for
all requests entering your application and configures autoloading. This
directory also houses your assets such as images, JavaScript, and CSS.
 Resources Directory: Contains your views as well as your raw, un-compiled
assets such as LESS, SASS, or JavaScript.
 Routes Directory: Contains all of the route definitions for your application.
 Storage Directory: Contains your compiled Blade templates, file based
sessions, file caches, and other files generated by the framework.
 Tests Directory: Contains your automated tests.
 Vendor Directory: Contains your composer dependencies.
Default Laravel Technologies
The following technologies are included by default:
 Jquery: A cross-platform Js library designed to simplify the client-side scripting of
HTML.
 Bootstrap: Bootstrap is the most popular HTML, CSS, and Js framework for
developing responsive, mobile-first web sites
 Axios: A Js library used to make http requests from node.js or XMLHttpRequests
from the browser and it supports the Promise API that is native to JS ES6.
 Vue: Popular Js framework for building user interfaces.
 Lodash: A Js library that helps programmers write more concise and easier to
maintain Js.
 Cross-env: Run scripts that set and use environment variables across platforms
Letz Code
Laravel App Development Steps
 Verify that inside the .env file, APP_KEY is set and APP_DEBUG is set
to true
 Set the DB_CONNECTION, DB_HOST, DB_PORT, DB_DATABASE,
DB_USERNAME and DB_PASSWORD correctly.
 Create and migrate your database migration
 Create the model
 Create the controller
 Create the route inside your route/web.php file
 Create the View
Say Hi to Eloquent ORM!
Eloquent ORM allow developers use Active Record pattern.
Active Record pattern is a technique of wrapping database into objects.
By using this technique, developers can present data stored in a
database table as class, and row as an object. Each database
table has a corresponding “Model” which is used to interact with that
table. It helps to make our codes look cleaner and readable. We can
use Eloquent ORM to create, edit, manipulate, query and delete entries
easily
Eloquent Model Methods
• Model::create(array('key' => 'value'));
• Model::update(array('key' => 'value'));
• Model::delete(1);
• Model::all();
• Model::find(1);
• // Trigger an exception
• Model::findOrFail(1);
• Model::where('foo', '=', 'bar')->get();
• Model::where('foo', '=', 'bar')->first();
• // Exception
• Model::where('foo', '=', 'bar')->firstOrFail();
• Model::where('foo', '=', 'bar')->count();
• Model::where('foo', '=', 'bar')->delete();
• Model::whereRaw('foo = bar and cars = 2', array(20))->get();
• Model::on('connection-name')->find(1);
• Model::with('relation')->get();
• Model::all()->take(10);
• Model::all()->skip(10)
Understanding Controllers
 Index: Display a listing of the resource.
 Create: Show the form for creating a new resource.
 Store: Store a newly created resource in the storage.
 Show: Display the specified resource.
 Edit: Show the form for editing the specified resource.
 Update: Update the specified resource in storage.
 Destroy: Delete the specified resource from storage.
Understanding Route Parameters
• Route::get('foo', function(){});
• Route::get('foo', 'ControllerName@function');
• Route::get('foo/{bar}', function($bar){});
• Route::get('foo/{bar}', 'ControllerName@function');
• Route::post('foo', function(){});
• Route::put('foo', function(){});
• Route::delete('foo', function(){});
RESTFUL ACTIONS
• Route::resource('foo', 'FooController');
QUESTIONS
??
THANKS

Contenu connexe

Tendances

Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptx
SaziaRahman
 

Tendances (20)

Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web Artisans
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
 
Web Development with Laravel 5
Web Development with Laravel 5Web Development with Laravel 5
Web Development with Laravel 5
 
Why Laravel?
Why Laravel?Why Laravel?
Why Laravel?
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Spring boot
Spring bootSpring boot
Spring boot
 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel framework
 
What-is-Laravel-23-August-2017.pptx
What-is-Laravel-23-August-2017.pptxWhat-is-Laravel-23-August-2017.pptx
What-is-Laravel-23-August-2017.pptx
 
Spring Boot Tutorial
Spring Boot TutorialSpring Boot Tutorial
Spring Boot Tutorial
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptx
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Spring boot
Spring bootSpring boot
Spring boot
 
Spring User Guide
Spring User GuideSpring User Guide
Spring User Guide
 
Laravel Eloquent ORM
Laravel Eloquent ORMLaravel Eloquent ORM
Laravel Eloquent ORM
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
AngularJS
AngularJS AngularJS
AngularJS
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
 
Angular
AngularAngular
Angular
 
Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 

Similaire à Laravel overview

Web application development with laravel php framework version 4
Web application development with laravel php framework version 4Web application development with laravel php framework version 4
Web application development with laravel php framework version 4
Untung D Saptoto
 
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Lorvent56
 

Similaire à Laravel overview (20)

Laravel - A Trending PHP Framework
Laravel - A Trending PHP FrameworkLaravel - A Trending PHP Framework
Laravel - A Trending PHP Framework
 
Why Laravel is the first choice for Web development_.pdf
Why Laravel is the first choice for Web development_.pdfWhy Laravel is the first choice for Web development_.pdf
Why Laravel is the first choice for Web development_.pdf
 
Laravel : A Fastest Growing Kid
Laravel : A Fastest Growing KidLaravel : A Fastest Growing Kid
Laravel : A Fastest Growing Kid
 
Ruby Rails Web Development
Ruby Rails Web DevelopmentRuby Rails Web Development
Ruby Rails Web Development
 
Web application development with laravel php framework version 4
Web application development with laravel php framework version 4Web application development with laravel php framework version 4
Web application development with laravel php framework version 4
 
cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)
 
Web presentation
Web presentationWeb presentation
Web presentation
 
Latest Laravel Practice 2023 Experts Guidance.pdf
Latest Laravel Practice 2023 Experts Guidance.pdfLatest Laravel Practice 2023 Experts Guidance.pdf
Latest Laravel Practice 2023 Experts Guidance.pdf
 
13 Advantages of Using Laravel for Web Development.pdf
13 Advantages of Using Laravel for Web Development.pdf13 Advantages of Using Laravel for Web Development.pdf
13 Advantages of Using Laravel for Web Development.pdf
 
Laravel Web Development: A Comprehensive Guide
Laravel Web Development: A Comprehensive GuideLaravel Web Development: A Comprehensive Guide
Laravel Web Development: A Comprehensive Guide
 
Why is Laravel the best framework for startups?
Why is Laravel the best framework for startups?Why is Laravel the best framework for startups?
Why is Laravel the best framework for startups?
 
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
Laravel Starter Kit | Laravel Admin Template-ChandraAdmin
 
Hidden things uncovered about laravel development
Hidden things uncovered about laravel developmentHidden things uncovered about laravel development
Hidden things uncovered about laravel development
 
Frequently Asked Questions About Laravel
Frequently Asked Questions About LaravelFrequently Asked Questions About Laravel
Frequently Asked Questions About Laravel
 
Lecture11_LaravelGetStarted_SPring2023.pdf
Lecture11_LaravelGetStarted_SPring2023.pdfLecture11_LaravelGetStarted_SPring2023.pdf
Lecture11_LaravelGetStarted_SPring2023.pdf
 
laravel-interview-questions.pdf
laravel-interview-questions.pdflaravel-interview-questions.pdf
laravel-interview-questions.pdf
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Ruby On Rails Siddhesh
Ruby On Rails SiddheshRuby On Rails Siddhesh
Ruby On Rails Siddhesh
 
Laravel: Unleashing the power of PHP
Laravel: Unleashing the power  of PHPLaravel: Unleashing the power  of PHP
Laravel: Unleashing the power of PHP
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHP
 

Dernier

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Dernier (20)

%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 

Laravel overview

  • 2. ABOUT THE SPEAKER Developer and Web Admin @ Headquarters Nigerian Airforce Twitter – https://www.twitter.com/awulonu_obinna Facebook – https://www.facebook.com/awulonuobinna GitHub – https://www.github.com/obinosteve #phpenthusiast #laravelevangelist
  • 3. What is Laravel? Laravel is a free, open-sourcePHP web framework, used for development of web applications following the model-view controller (MVC) architectural pattern.
  • 4. What is a Framework? A framework is a piece of code which dictates the architecture your project will follow. Once you choose a framework to work with, you have to follow the framework's code and design methodologies. The framework will provide you with hooks and callbacks, so that you build on it - it will then call your plugged-in code whenever it wishes, a phenomenon called Inversion of Control.
  • 5. What is mvc? The Model-View-Controller (MVC) is an architectural pattern that provides a reusable solution to resolve common problems that occurs while developing a Web application. It separates an application into three main logical components: the model, view and controller.
  • 6. Model: The model is responsible for managing the data of the application. It responds to the request from the view and it also responds to instructions from the controller to update itself. View: The View component is used for all the UI logic of the application. The view includes all the UI components such as text boxes, dropdowns, buttons, etc. that the final user interacts with. Controller: Controller is responsible for controlling the application logic and acts as the coordinator between the View and the Model. The Controller receives input from users via the View, then process the user's data with the help of Model and passing the results back to the View.
  • 7. Benefits of the MVC Pattern  Separation of concerns: Enables you to ensure that various application concerns into different and independent software components. Thus, it allows you to work on a single component independently.  Simplified testing and maintenance: Enables you to test each component independently.  Extensibility: Enables the model to include a set of independent components that you can easily modify or replace based on the application requirement.  Faster development process  Ability to provide multiple views  SEO friendly Development platform: It is very easy to develop SEO-friendly URLs to generate more visits from a specific application.
  • 8. Architecture of a Laravel Application
  • 9. Did we miss anything? Routing? What is Routing in Laravel ?
  • 10. Routing Routing defines how the application will process and respond to incoming HTTP request. You can use URLs that properly describes the controller action to which the request needs to be routed. Routing enables use of URLs that are descriptive of the user actions and are more easily understood by the users. e.g Instead of http://myapplication/Users.php?id=1 we can http://myapplication/Users/1
  • 12. Environment Setup  Laravel Homestead https://laravel.com/docs/5.5/homestead  Laragon https://laragon.org/  Method 3:  Wamp server: http://www.wampserver.com/en/  Composer: https://getcomposer.org/download/  Nodejs: https://nodejs.org/en/  Npm: Installed on your computer when you install Node.js
  • 13. Create new Laravel Project  From your command prompt or terminal or git bash, run: composer create-project --prefer-dist laravel/laravel projectname  Run your first laravel application: php artisan serve CONGRATULATIONS You have successfully ran your first laravel app
  • 15.  App Directory: Contains the core code of your application. A variety of other directories will be generated inside the app directory as you use the make Artisan commands to generate classes.  Bootstrap Directory: Contains the app.php file which bootstraps the framework.  Config Directory: Contains all of your application's configuration files.  Database Directory: Contains your database migration and seeds.  Public Directory: Contains the index.php file, which is the entry point for all requests entering your application and configures autoloading. This directory also houses your assets such as images, JavaScript, and CSS.  Resources Directory: Contains your views as well as your raw, un-compiled assets such as LESS, SASS, or JavaScript.  Routes Directory: Contains all of the route definitions for your application.  Storage Directory: Contains your compiled Blade templates, file based sessions, file caches, and other files generated by the framework.  Tests Directory: Contains your automated tests.  Vendor Directory: Contains your composer dependencies.
  • 16. Default Laravel Technologies The following technologies are included by default:  Jquery: A cross-platform Js library designed to simplify the client-side scripting of HTML.  Bootstrap: Bootstrap is the most popular HTML, CSS, and Js framework for developing responsive, mobile-first web sites  Axios: A Js library used to make http requests from node.js or XMLHttpRequests from the browser and it supports the Promise API that is native to JS ES6.  Vue: Popular Js framework for building user interfaces.  Lodash: A Js library that helps programmers write more concise and easier to maintain Js.  Cross-env: Run scripts that set and use environment variables across platforms
  • 18. Laravel App Development Steps  Verify that inside the .env file, APP_KEY is set and APP_DEBUG is set to true  Set the DB_CONNECTION, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD correctly.  Create and migrate your database migration  Create the model  Create the controller  Create the route inside your route/web.php file  Create the View
  • 19. Say Hi to Eloquent ORM! Eloquent ORM allow developers use Active Record pattern. Active Record pattern is a technique of wrapping database into objects. By using this technique, developers can present data stored in a database table as class, and row as an object. Each database table has a corresponding “Model” which is used to interact with that table. It helps to make our codes look cleaner and readable. We can use Eloquent ORM to create, edit, manipulate, query and delete entries easily
  • 20. Eloquent Model Methods • Model::create(array('key' => 'value')); • Model::update(array('key' => 'value')); • Model::delete(1); • Model::all(); • Model::find(1); • // Trigger an exception • Model::findOrFail(1); • Model::where('foo', '=', 'bar')->get(); • Model::where('foo', '=', 'bar')->first(); • // Exception • Model::where('foo', '=', 'bar')->firstOrFail(); • Model::where('foo', '=', 'bar')->count(); • Model::where('foo', '=', 'bar')->delete(); • Model::whereRaw('foo = bar and cars = 2', array(20))->get(); • Model::on('connection-name')->find(1); • Model::with('relation')->get(); • Model::all()->take(10); • Model::all()->skip(10)
  • 21. Understanding Controllers  Index: Display a listing of the resource.  Create: Show the form for creating a new resource.  Store: Store a newly created resource in the storage.  Show: Display the specified resource.  Edit: Show the form for editing the specified resource.  Update: Update the specified resource in storage.  Destroy: Delete the specified resource from storage.
  • 22. Understanding Route Parameters • Route::get('foo', function(){}); • Route::get('foo', 'ControllerName@function'); • Route::get('foo/{bar}', function($bar){}); • Route::get('foo/{bar}', 'ControllerName@function'); • Route::post('foo', function(){}); • Route::put('foo', function(){}); • Route::delete('foo', function(){}); RESTFUL ACTIONS • Route::resource('foo', 'FooController');