SlideShare a Scribd company logo
1
WHY LARAVEL?
“The PHP Framework For Web Artisans”
Introduction to Laravel
Jonathan Goode
2 . 1
HISTORY BEHIND THE VISION
, a .NET developer in Arkansas (USA), was using an
early version of CodeIgniter when the idea for Laravel came to
him.
“I couldn't add all the features I wanted to”, he says, “without
mangling the internal code of the framework”.
He wanted something leaner, simpler, and more flexible.
Taylor Otwell
2 . 2
HISTORY BEHIND THE VISION
Those desires, coupled with Taylor's .NET background, spawned
the framework that would become Laravel.
He used the ideas of the .NET infrastructure which Microso had
built and spent hundreds of millions of dollars of research on.
With Laravel, Taylor sought to create a framework that would be
known for its simplicity.
He added to that simplicity by including an expressive syntax, clear structure,
and incredibly thorough documentation.
With that, Laravel was born.
3 . 1
THE EVOLUTION OF LARAVEL
Taylor started with a simple routing layer and a really simple
controller-type interface (MVC)
v1 and v2 were released in June 2011 and September 2011 respectively, just
months apart
In February 2012, Laravel 3 was released just over a year later
and this is when Laravel's user base and popularity really began
to grow.
3 . 2
THE EVOLUTION OF LARAVEL
In May 2013, Laravel 4 was released as a complete rewrite of the
framework and incorporated a package manager called
.
Composer is an application-level package manager for PHP that
allowed people to collaborate instead of compete.
Before Composer, there was no way to take two separate
packages and use different pieces of those packages together to
create a single solution.
Laravel is built on top of several packages most notably
.
Composer
Symfony
3 . 3
LARAVEL TODAY
Laravel now stands at version 5.3 with 5.4 currently in
development
Support for PHP 7 has recently been added to Laravel 4.2.20
and for the first version ever, long term support has been
guaranteed for 5.1
4 . 1
ARCHITECTURE
Model
Everything database related - Eloquent ORM (Object Relational
Mapper)
View
HTML structure - Blade templating engine
Controller
Processing requests and generating output
+ Facades, Dependency Injection, Repositories, etc...
4 . 2
FIRSTLY, WHY OBJECT ORIENTED PHP?
Logic is split into classes where each class has specific attributes
and behaviours.
This leads to code that is more maintainable, more predictable
and simpler to test.
5 . 1
ROUTES
Routes (/routes) hold the application
URLs
web.php for web routes
api.php for stateless requests
console.php for Artisan commands
// Visiting '/' will return 'Hello World!' 
Route::get('/', function() 
{ 
    return 'Hello World!'; 
}); 
Route::get('/tasks/{id}', 'TasksController@view'); 
Visiting /tasks/3 will call the controller method that deals
with viewing that task that has an id of 3
5 . 2
Route::post('/tasks/add', 'TasksController@store'); 
Handles posting for data when creating a form
No need to check for
isset($_POST['input'])
5 . 3
6 . 1
CONTROLLERS
Handle the logic required for processing requests
namespace AppHttpControllersAdmin; 
class TasksController extends Controller 
{ 
    public function view($id) 
    { 
        return "This is task " . $id; 
    } 
} 
6 . 2
ENHANCED CONTROLLER
namespace AppHttpControllersAdmin; 
class TasksController extends Controller 
{ 
    public function view($id) 
    { 
        // Finds the task with 'id' = $id in the tasks table 
        $task = Task::find($id); 
        // Returns a view with the task data 
        return View::make('tasks.view')­>with(compact('task')); 
    } 
}
7 . 1
MODELS
Classes that are used to access the
database
A Task model would be tied to the tasks table in MySQL
namespace AppModels; 
use IlluminateDatabaseEloquentModel; 
use IlluminateDatabaseEloquentSoftDeletes; 
class Task extends Model 
{ 
    use SoftDeletes; 
    protected $fillable = ['title', 'done',]; 
    protected $dates    = ['deleted_at']; 
} 
7 . 2
QUERIES
// Retrieves the tasks that have a high priority 
Task::where('priority', '=', 'high')­>get(); 
Task::wherePriority('high')­>get(); // *Magic*! 
// Retrieves all the tasks in the database 
Task::all(); 
// Retrieves a paginated view for tasks, 20 tasks per page 
Task::paginate(20); 
// Inserts a new task into the database 
Task::create(['description' => 'Buy milk']); 
// (Soft) deletes the task with an id of 5 
Task::find(5)­>delete(); 
// Permanently deletes all soft deleted tasks 
Task::onlyTrashed()­>forceDelete(); 
8 . 1
VIEWS
Blade is a simple, yet powerful templating engine provided with
Laravel
// This view uses the master layout 
@extends('layouts.master') 
@section('content') 
    <p>This is my body content.</p> 
@stop 
@section('sidebar') 
    <p>This is appended to the master sidebar.</p> 
@stop 
8 . 2
@foreach($tasks as $task) 
    <p>{{ $task­>title }}</p> 
@endforeach 
=
<?php foreach ($tasks as $task) { 
    <p><?php echo $task­>title ?></p> 
<?php endforeach ?>
8 . 3
<p>Tasks:</p> 
<table> 
    <thead> 
        <tr> 
            <th>ID</th> 
            <th>Title</th> 
        </tr> 
    </thead> 
    <tbody> 
        @foreach($tasks as $task) 
        <tr> 
            <td>{{ $task­>id }}</td> 
            <td>{{ $task­>title }}</td> 
        </tr> 
        @endforeach 
    </tbody> 
</table>
8 . 4
9 . 1
ARTISAN
Artisan is the command-line interface included with Laravel
It provides a number of helpful commands that can assist you
while you build your application
$ php artisan list 
$ php artisan help migrate 
9 . 2
DATA MIGRATION AND SEEDING
$ php artisan make:migration create_users_table 
Migration created successfully! 
$ php artisan migrate ­­seed 
Migrated: 2016_01_12_000000_create_users_table 
Migrated: 2016_01_12_100000_create_password_resets_table 
Migrated: 2016_01_13_162500_create_projects_table 
Migrated: 2016_01_13_162508_create_servers_table
10 . 1
KEY CHANGES IN LARAVEL 5
DIRECTORY STRUCTURE
Laravel 5 implements the autoloading standard which
means all your classes are namespaced
The default namespace for your web application is app
You can change this using php artisan app:name <your‐app‐name>
assets, views, and lang now live in a resources folder
config, storage, database, and tests directories have
been moved to the root of the project
bootstrap, public, and vendor retain their place
PSR-4
10 . 2
KEY CHANGES IN LARAVEL 5
ENVIRONMENT DETECTION
Instead of all the complex nested configuration directories, you
have a .env file at the root of your project to take care
of the application environment and all the environment
variables.
It is useful to create a .env.example file to provide a template
for other team members to follow
(dotEnv)
10 . 3
KEY CHANGES IN LARAVEL 5
ROUTE MIDDLEWARE
Middleware can be used to add extra layers to your HTTP routes.
If you want code to execute before every route or before specific
routes in your application, then such a piece of code is a good fit
for a middleware class.
For example, let's say you want to block out a certain range of
IPs from your application to make your application unavailable
in that region.
In such a case, you will need to check the client IP before every
request and allow/disallow them entry to your application.
$ php artisan make:middleware "RegionMiddleware"
10 . 4
KEY CHANGES IN LARAVEL 5
METHOD INJECTION
Until version 4.2, you had to request the Inversion of Control
(IoC) container to provide a class instance or create it in your
controller's constructor to make it accessible under the class
scope.
Now, you can declare the type hinted class instance in the
controller method's signature and the IoC container will take
care of it, even if there are multiple parameters in your controller
function's signature.
10 . 5
EXAMPLE OF METHOD INJECTION
// TaskController.php 
namespace AppHttpControllersAdmin; 
use AppHttpControllersController; 
use AppHttpRequestsAdminTaskUpdateRequest; 
use AppModelsTask; 
class TaskController extends Controller { 
    public function store(TaskUpdateRequest $request) { 
        $task = Task::create($request­>except('_token')); 
        return redirect(route('admin.task.index'))­>with('success', 
                        trans('general.created', ['what' => 'Task'])); 
    } 
} 
/**/ 
class TaskUpdateRequest extends FormRequest { 
    public function rules() { 
        return ['title' => 'required|min:3|unique:tasks,title',]; 
    } 
}
10 . 6
KEY CHANGES IN LARAVEL 5
CONTRACTS
Contracts are actually interface classes in disguise.
Interfaces are a tried and tested method for removing class
dependency and developing loosely coupled so ware
components.
.
Most of the major core components make use of these contracts to keep the
framework loosely coupled.
Laravel buys into the same philosophy ⇲
10 . 7
KEY CHANGES IN LARAVEL 5
AUTHENTICATION
Authentication is part of almost all the web applications you
develop, and a lot of time is spent writing the authentication
boilerplate.
This is not the case any more with Laravel 5. The database
migrations, models, controllers, and views just need to be
configured to make it all work.
Laravel 5 has a Registrar service, which is a crucial part of this
out of the box, ready to use authentication system.
10 . 8
OTHER KEY CHANGES IN LARAVEL 5
Queue and Task
Scheduling
Crons taken care of
Multiple File Systems
Local or remote (cloud based)
Route Caching
Events
Commands
11 . 1
LARAVEL ELIXIR
provides a fluent, expressive interface to compiling
and concatenating your assets.
If you've ever been intimidated by learning Gulp or Grunt, fear
no more.
Elixir makes it a cinch to get started using Gulp to compile Sass
and other assets.
It can even be configured to run your tests
Laravel Elixir
(Assumes sass is located at resources/assets/sass, etc.)
// gulpfile.js 
const elixir             = require('laravel­elixir'); 
elixir.config.publicPath = 'public_html/assets'; 
require('laravel­elixir­vue­2'); 
elixir(mix => { 
    mix.sass('app.scss') 
       .webpack('app.js') 
       .copy('node_modules/bootstrap­sass/assets/fonts/bootstrap/', 
             'public_html/assets/fonts/bootstrap'); 
}); 
11 . 2
// Run all tasks and build your assets 
$ gulp 
// Run all tasks and minify all CSS and JavaScript 
$ gulp ­­production 
// Watch your assets for any changes ­ re­build when required 
$ gulp watch 
11 . 3
12
LARAVEL STARTER ⇲
Created specifically to speed up development at UofA
Improved version of Laravel 4.1 with backported
enhancements from 4.2
This was due to the version of PHP (5.3.8) we previously had to use
Has code specific for the way we have to work with web
accounts
Configured to use public_html rather than public
LDAP integration complete with configuration for abdn.ac.uk
Enhanced String and Array helpers
UofA logos
etc.
Currently in the process of updating for Laravel 5.3
13 . 1
LARAVEL HAS MORE UP ITS SLEEVE
STANDALONE SERVICES
Provision and deploy unlimited PHP applications on DigitalOcean, Linode,
and AWS
A package that provides scaffolding for subscription billing, invoices, etc.
A deployment service focused on the deployment side of applications and
includes things like zero downtime deploys, health checks, cron job
monitoring, and more
Forge
Spark
Envoyer
13 . 2
LARAVEL HAS MORE UP ITS SLEEVE
BAKED INTO LARAVEL 5
Event broadcasting, evolved. Bring the power of WebSockets to your
application without the complexity.
API authentication without the headache. Passport is an OAuth2 server that's
ready in minutes.
Driver based full-text search for Eloquent, complete with pagination and
automatic indexing.
Laravel Echo
Laravel Passport
Laravel Scout
13 . 3
LARAVEL HAS MORE UP ITS SLEEVE
OTHER DEVELOPMENT TOOLS
Powered by Vagrant, Homestead gets your entire team on the same page
with the latest PHP, MySQL, Postgres, Redis, and more.
Cachet is the best way to inform customers of downtime. This is your status
page.
If all you need is an API and lightning fast speed, try Lumen. It's Laravel
smaller-light.
Need a CMS that runs on Laravel and is built for developers and clients? Look
no further.
Homestead
Cachet
Lumen
Statamic
14
MORE RESOURCES
Over 900 videos covering all aspects of using
Laravel
https://laravel.com/
https://laracasts.com/

More Related Content

PPTX
laravel.pptx
PPTX
Laravel overview
PPTX
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
PPTX
Laravel Tutorial PPT
PPTX
Introduction to laravel framework
PDF
Web Development with Laravel 5
PPTX
Laravel introduction
PDF
Laravel presentation
laravel.pptx
Laravel overview
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel Tutorial PPT
Introduction to laravel framework
Web Development with Laravel 5
Laravel introduction
Laravel presentation

What's hot (20)

PDF
Laravel Introduction
PPTX
Introduction to Laravel Framework (5.2)
PPTX
Laravel
PPTX
Lecture 2_ Intro to laravel.pptx
PPTX
Laravel
PPTX
Laravel Eloquent ORM
PPT
Maven Introduction
ODP
Projects In Laravel : Learn Laravel Building 10 Projects
PPTX
Laravel ppt
PPTX
What-is-Laravel-23-August-2017.pptx
PPTX
Maven ppt
PPT
PPTX
An Introduction To REST API
PDF
An introduction to Vue.js
PDF
Laravel - The PHP Framework for Web Artisans
PPTX
Introduction to Spring Boot
PPTX
C# REST API
PPTX
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
PPT
Maven Overview
Laravel Introduction
Introduction to Laravel Framework (5.2)
Laravel
Lecture 2_ Intro to laravel.pptx
Laravel
Laravel Eloquent ORM
Maven Introduction
Projects In Laravel : Learn Laravel Building 10 Projects
Laravel ppt
What-is-Laravel-23-August-2017.pptx
Maven ppt
An Introduction To REST API
An introduction to Vue.js
Laravel - The PHP Framework for Web Artisans
Introduction to Spring Boot
C# REST API
Introduction To DevOps | Devops Tutorial For Beginners | DevOps Training For ...
Maven Overview
Ad

Viewers also liked (10)

PPTX
Laravel5 Introduction and essentials
PPTX
Laravel Beginners Tutorial 1
PDF
Laravel Development Company Services – TechTic Solutions
PPTX
A introduction to Laravel framework
PDF
Laravel and Django and Rails, Oh My!
PDF
Knowing Laravel 5 : The most popular PHP framework
PPTX
Laravel 5
PDF
Laravel.IO A Use-Case Architecture
PDF
Laravel 5 In Depth
PDF
Digpen 7: Why choose Laravel?
Laravel5 Introduction and essentials
Laravel Beginners Tutorial 1
Laravel Development Company Services – TechTic Solutions
A introduction to Laravel framework
Laravel and Django and Rails, Oh My!
Knowing Laravel 5 : The most popular PHP framework
Laravel 5
Laravel.IO A Use-Case Architecture
Laravel 5 In Depth
Digpen 7: Why choose Laravel?
Ad

Similar to Why Laravel? (20)

PDF
Laravel 4 presentation
PDF
MidwestPHP 2016 - Adventures in Laravel 5
PPTX
What-is-Laravel and introduciton to Laravel
PDF
Laravel 5 New Features
PDF
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
PDF
laravel-interview-questions.pdf
PPTX
Laravel session 1
PPTX
Laravel 5
PPTX
Getting started with laravel
PDF
Object Oriented Programming with Laravel - Session 2
PDF
Hidden things uncovered about laravel development
PDF
Memphis php 01 22-13 - laravel basics
PDF
Laravel - A Trending PHP Framework
PDF
Lecture11_LaravelGetStarted_SPring2023.pdf
PDF
Getting to know Laravel 5
PDF
Laravel -The PHP Framework that Transformed Web Development_.pdf
PDF
Laravel intake 37 all days
PPTX
Laravel : A Fastest Growing Kid
PDF
RESTful API development in Laravel 4 - Christopher Pecoraro
PPTX
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
Laravel 4 presentation
MidwestPHP 2016 - Adventures in Laravel 5
What-is-Laravel and introduciton to Laravel
Laravel 5 New Features
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
laravel-interview-questions.pdf
Laravel session 1
Laravel 5
Getting started with laravel
Object Oriented Programming with Laravel - Session 2
Hidden things uncovered about laravel development
Memphis php 01 22-13 - laravel basics
Laravel - A Trending PHP Framework
Lecture11_LaravelGetStarted_SPring2023.pdf
Getting to know Laravel 5
Laravel -The PHP Framework that Transformed Web Development_.pdf
Laravel intake 37 all days
Laravel : A Fastest Growing Kid
RESTful API development in Laravel 4 - Christopher Pecoraro
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)

Recently uploaded (20)

PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
System and Network Administraation Chapter 3
PDF
medical staffing services at VALiNTRY
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
DOCX
The Five Best AI Cover Tools in 2025.docx
PPTX
Essential Infomation Tech presentation.pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
AI in Product Development-omnex systems
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Online Work Permit System for Fast Permit Processing
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Odoo POS Development Services by CandidRoot Solutions
How to Migrate SBCGlobal Email to Yahoo Easily
System and Network Administraation Chapter 3
medical staffing services at VALiNTRY
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
The Five Best AI Cover Tools in 2025.docx
Essential Infomation Tech presentation.pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
ISO 45001 Occupational Health and Safety Management System
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
How to Choose the Right IT Partner for Your Business in Malaysia
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
AI in Product Development-omnex systems
Design an Analysis of Algorithms I-SECS-1021-03
2025 Textile ERP Trends: SAP, Odoo & Oracle
Online Work Permit System for Fast Permit Processing
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises

Why Laravel?

  • 1. 1 WHY LARAVEL? “The PHP Framework For Web Artisans” Introduction to Laravel Jonathan Goode
  • 2. 2 . 1 HISTORY BEHIND THE VISION , a .NET developer in Arkansas (USA), was using an early version of CodeIgniter when the idea for Laravel came to him. “I couldn't add all the features I wanted to”, he says, “without mangling the internal code of the framework”. He wanted something leaner, simpler, and more flexible. Taylor Otwell
  • 3. 2 . 2 HISTORY BEHIND THE VISION Those desires, coupled with Taylor's .NET background, spawned the framework that would become Laravel. He used the ideas of the .NET infrastructure which Microso had built and spent hundreds of millions of dollars of research on. With Laravel, Taylor sought to create a framework that would be known for its simplicity. He added to that simplicity by including an expressive syntax, clear structure, and incredibly thorough documentation. With that, Laravel was born.
  • 4. 3 . 1 THE EVOLUTION OF LARAVEL Taylor started with a simple routing layer and a really simple controller-type interface (MVC) v1 and v2 were released in June 2011 and September 2011 respectively, just months apart In February 2012, Laravel 3 was released just over a year later and this is when Laravel's user base and popularity really began to grow.
  • 5. 3 . 2 THE EVOLUTION OF LARAVEL In May 2013, Laravel 4 was released as a complete rewrite of the framework and incorporated a package manager called . Composer is an application-level package manager for PHP that allowed people to collaborate instead of compete. Before Composer, there was no way to take two separate packages and use different pieces of those packages together to create a single solution. Laravel is built on top of several packages most notably . Composer Symfony
  • 6. 3 . 3 LARAVEL TODAY Laravel now stands at version 5.3 with 5.4 currently in development Support for PHP 7 has recently been added to Laravel 4.2.20 and for the first version ever, long term support has been guaranteed for 5.1
  • 7. 4 . 1 ARCHITECTURE Model Everything database related - Eloquent ORM (Object Relational Mapper) View HTML structure - Blade templating engine Controller Processing requests and generating output + Facades, Dependency Injection, Repositories, etc...
  • 8. 4 . 2 FIRSTLY, WHY OBJECT ORIENTED PHP? Logic is split into classes where each class has specific attributes and behaviours. This leads to code that is more maintainable, more predictable and simpler to test.
  • 9. 5 . 1 ROUTES Routes (/routes) hold the application URLs web.php for web routes api.php for stateless requests console.php for Artisan commands // Visiting '/' will return 'Hello World!'  Route::get('/', function()  {      return 'Hello World!';  }); 
  • 10. Route::get('/tasks/{id}', 'TasksController@view');  Visiting /tasks/3 will call the controller method that deals with viewing that task that has an id of 3
  • 11. 5 . 2 Route::post('/tasks/add', 'TasksController@store');  Handles posting for data when creating a form No need to check for isset($_POST['input'])
  • 12. 5 . 3 6 . 1 CONTROLLERS Handle the logic required for processing requests namespace AppHttpControllersAdmin;  class TasksController extends Controller  {      public function view($id)      {          return "This is task " . $id;      }  } 
  • 13. 6 . 2 ENHANCED CONTROLLER namespace AppHttpControllersAdmin;  class TasksController extends Controller  {      public function view($id)      {          // Finds the task with 'id' = $id in the tasks table          $task = Task::find($id);          // Returns a view with the task data          return View::make('tasks.view')­>with(compact('task'));      }  }
  • 14. 7 . 1 MODELS Classes that are used to access the database A Task model would be tied to the tasks table in MySQL namespace AppModels;  use IlluminateDatabaseEloquentModel;  use IlluminateDatabaseEloquentSoftDeletes;  class Task extends Model  {      use SoftDeletes;      protected $fillable = ['title', 'done',];      protected $dates    = ['deleted_at'];  } 
  • 16. 8 . 1 VIEWS Blade is a simple, yet powerful templating engine provided with Laravel // This view uses the master layout  @extends('layouts.master')  @section('content')      <p>This is my body content.</p>  @stop  @section('sidebar')      <p>This is appended to the master sidebar.</p>  @stop 
  • 19. 8 . 4 9 . 1 ARTISAN Artisan is the command-line interface included with Laravel It provides a number of helpful commands that can assist you while you build your application $ php artisan list  $ php artisan help migrate 
  • 20. 9 . 2 DATA MIGRATION AND SEEDING $ php artisan make:migration create_users_table  Migration created successfully!  $ php artisan migrate ­­seed  Migrated: 2016_01_12_000000_create_users_table  Migrated: 2016_01_12_100000_create_password_resets_table  Migrated: 2016_01_13_162500_create_projects_table  Migrated: 2016_01_13_162508_create_servers_table
  • 21. 10 . 1 KEY CHANGES IN LARAVEL 5 DIRECTORY STRUCTURE Laravel 5 implements the autoloading standard which means all your classes are namespaced The default namespace for your web application is app You can change this using php artisan app:name <your‐app‐name> assets, views, and lang now live in a resources folder config, storage, database, and tests directories have been moved to the root of the project bootstrap, public, and vendor retain their place PSR-4
  • 22. 10 . 2 KEY CHANGES IN LARAVEL 5 ENVIRONMENT DETECTION Instead of all the complex nested configuration directories, you have a .env file at the root of your project to take care of the application environment and all the environment variables. It is useful to create a .env.example file to provide a template for other team members to follow (dotEnv)
  • 23. 10 . 3 KEY CHANGES IN LARAVEL 5 ROUTE MIDDLEWARE Middleware can be used to add extra layers to your HTTP routes. If you want code to execute before every route or before specific routes in your application, then such a piece of code is a good fit for a middleware class. For example, let's say you want to block out a certain range of IPs from your application to make your application unavailable in that region. In such a case, you will need to check the client IP before every request and allow/disallow them entry to your application. $ php artisan make:middleware "RegionMiddleware"
  • 24. 10 . 4 KEY CHANGES IN LARAVEL 5 METHOD INJECTION Until version 4.2, you had to request the Inversion of Control (IoC) container to provide a class instance or create it in your controller's constructor to make it accessible under the class scope. Now, you can declare the type hinted class instance in the controller method's signature and the IoC container will take care of it, even if there are multiple parameters in your controller function's signature.
  • 25. 10 . 5 EXAMPLE OF METHOD INJECTION // TaskController.php  namespace AppHttpControllersAdmin;  use AppHttpControllersController;  use AppHttpRequestsAdminTaskUpdateRequest;  use AppModelsTask;  class TaskController extends Controller {      public function store(TaskUpdateRequest $request) {          $task = Task::create($request­>except('_token'));          return redirect(route('admin.task.index'))­>with('success',                          trans('general.created', ['what' => 'Task']));      }  }  /**/  class TaskUpdateRequest extends FormRequest {      public function rules() {          return ['title' => 'required|min:3|unique:tasks,title',];      }  }
  • 26. 10 . 6 KEY CHANGES IN LARAVEL 5 CONTRACTS Contracts are actually interface classes in disguise. Interfaces are a tried and tested method for removing class dependency and developing loosely coupled so ware components. . Most of the major core components make use of these contracts to keep the framework loosely coupled. Laravel buys into the same philosophy ⇲
  • 27. 10 . 7 KEY CHANGES IN LARAVEL 5 AUTHENTICATION Authentication is part of almost all the web applications you develop, and a lot of time is spent writing the authentication boilerplate. This is not the case any more with Laravel 5. The database migrations, models, controllers, and views just need to be configured to make it all work. Laravel 5 has a Registrar service, which is a crucial part of this out of the box, ready to use authentication system.
  • 28. 10 . 8 OTHER KEY CHANGES IN LARAVEL 5 Queue and Task Scheduling Crons taken care of Multiple File Systems Local or remote (cloud based) Route Caching Events Commands
  • 29. 11 . 1 LARAVEL ELIXIR provides a fluent, expressive interface to compiling and concatenating your assets. If you've ever been intimidated by learning Gulp or Grunt, fear no more. Elixir makes it a cinch to get started using Gulp to compile Sass and other assets. It can even be configured to run your tests Laravel Elixir (Assumes sass is located at resources/assets/sass, etc.)
  • 32. 11 . 3 12 LARAVEL STARTER ⇲ Created specifically to speed up development at UofA Improved version of Laravel 4.1 with backported enhancements from 4.2 This was due to the version of PHP (5.3.8) we previously had to use Has code specific for the way we have to work with web accounts Configured to use public_html rather than public LDAP integration complete with configuration for abdn.ac.uk Enhanced String and Array helpers UofA logos etc. Currently in the process of updating for Laravel 5.3
  • 33. 13 . 1 LARAVEL HAS MORE UP ITS SLEEVE STANDALONE SERVICES Provision and deploy unlimited PHP applications on DigitalOcean, Linode, and AWS A package that provides scaffolding for subscription billing, invoices, etc. A deployment service focused on the deployment side of applications and includes things like zero downtime deploys, health checks, cron job monitoring, and more Forge Spark Envoyer
  • 34. 13 . 2 LARAVEL HAS MORE UP ITS SLEEVE BAKED INTO LARAVEL 5 Event broadcasting, evolved. Bring the power of WebSockets to your application without the complexity. API authentication without the headache. Passport is an OAuth2 server that's ready in minutes. Driver based full-text search for Eloquent, complete with pagination and automatic indexing. Laravel Echo Laravel Passport Laravel Scout
  • 35. 13 . 3 LARAVEL HAS MORE UP ITS SLEEVE OTHER DEVELOPMENT TOOLS Powered by Vagrant, Homestead gets your entire team on the same page with the latest PHP, MySQL, Postgres, Redis, and more. Cachet is the best way to inform customers of downtime. This is your status page. If all you need is an API and lightning fast speed, try Lumen. It's Laravel smaller-light. Need a CMS that runs on Laravel and is built for developers and clients? Look no further. Homestead Cachet Lumen Statamic
  • 36. 14 MORE RESOURCES Over 900 videos covering all aspects of using Laravel https://laravel.com/ https://laracasts.com/