SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Laravel 5 New Features
Joe Ferguson
Before we begin
Have Virtualbox (virtualbox.org) Installed
Have VirtualBox Extension Pack Installed
Have Vagrant (vagrantup.com) Installed
run: vagrant box add laravel/homestead
New Directory Structure
Laravel 5 Directory
App directory now "Your Application" / "Entry point to app”
Laravel 4 Artisan Commands -> Console in App folder
Web stuff in Http
Controllers all have name space
filters.php -> Broken out into separate classes/files.
More focus on Service Providers -> Filter Service Providers
No more global.php -> Use service providers
Removed models directory. Can be just in app folder. PSR-4 default
Don't like the app namespace? artisan app:name MyApplication
Blade Changes
Laravel 4 uses {{ to echo and {{{ To echo escaped
Laravel 5 {{ and {{{ will echo escaped and {!! is used to echo raw
Biggest impact is likely form helpers: {!! Form::open() !!}
Commands
Commands (app/Commands) - Message containing only info needed
to do something
Command Handler (app/Handlers/Commands) - Class that does
something in response to a command
Command Bus - Allows dispatch of commands, matches commands
to handlers
Self handling commands just need a handle() method on the
command & implements SelfHandling
Events
Events (app/Events)
Events have handlers (similar to Commands)
Bind Events via appProvidersEventServiceProvider.php
Events inform the system something happened VS demanding
action from the system
Form Requests
Special class for validating and authorizing form submissions
Each class has rules() (returns array) and authorize() (returns boolean) methods
Benefit of rules & authorize being methods is you can perform logic
Type Hinting your forms to the Form Request will automatically validate your
forms
If validation fails, errors will be available to the view and redirected back.
This happens because the FormRequestServiceProvider listens for anything being
resolved is instance of FormRequest and calls the validate method.
Helpers
view() - Get a View instance for the given view path
action() - Generate a URL for a given controller action
app_path() - Get the fully qualified path to the app directory
asset() - Generate a URL for an asset.
Routing – get(), delete(), put()
Route Caching
artisan route:cache
Serializes your routes.php
Benefits: Faster routing
Drawback: Must run artisan route:clear on every routes.php
change
Middleware
Implements decorator pattern. request -> does work -> returns object to next
layer
Laravel uses middleware for Encrypting/Decrypting cookies, Reading/Writing
Sessions
artisan make:middleware MyMiddleware (app/Http/Middleware)
Middleware registered in app/Http/Kernel.php
Can run before or after the request has been processed.
Easiest example would be auth
Controller Method Injection
Can inject dependencies into methods, no longer via constructor
Purpose is to help developers write cleaner code
Changes to Illuminate Packages
Form or HTML helpers no longer in Core, must be pulled in via
composer.
add "laravelcollective/html": "~5.0" to composer
update config/app.php
Elixir
API for defining basic Gulp tasks for your app.
Requires nodejs
Put your sass/less files in resources/assets/sass|less
Can trigger sass/less/phpunit/phpspec, combine stylesheets
Socialite
Easy to use social logins with oauth
Supports Facebook, Twitter, Google, Github, and Bitbucket
Contracts
Set of interfaces that define the core services provided by the
framework
Depend on abstractions, not concrete dependencies.
Write code that doesn't have to be aware of the laravel framework
Upgrade from 4.2 to 5
Fresh install Laravel 5
Update Dependencies /Packages
Namespace (somewhat optional for now)
Migrate environment variables
Move routes to app/Http/routes.php
Move controllers to app/Http/Controllers (add this to classmap)
Copy route bindings to boot() in app/Providers/RouteServiceProvider.php
Add route facade to RouteServiceProvider.php to continue using Route facade
CSRF is now global. Use middleware to disable if needed
Move models to app/Models. Add app/Models to classmap in composer.json
Update your user auth to use Laravel 5’s auth system
Move commands to app/Console/Commands. Add app/Console/Commands to classmap in composer.json
Move migrations to database/migrations, Database Seeds to database/seeds
… and more!
Upgrade from 4.2 to 5
http://laravel.com/docs/5.0/upgradeFresh install Laravel 5
Update Dependencies /Packages
Namespace (somewhat optional for now)
Migrate environment variables
Move routes to app/Http/routes.php
Move controllers to app/Http/Controllers (add this to classmap)
Copy route bindings to boot() in app/Providers/RouteServiceProvider.php
Add route facade to RouteServiceProvider.php to continue using Route facade
CSRF is now global. Use middleware to disable if needed
Move models to app/Models. Add app/Models to classmap in composer.json
Update your user auth to use Laravel 5’s auth system
Move commands to app/Console/Commands. Add app/Console/Commands to classmap in composer.json
Move migrations to database/migrations, Database Seeds to database/seeds
… and more!
Homestead
“Laravel Homestead is an official, pre-packaged
Vagrant "box" that provides you a wonderful
development environment without requiring you
to install PHP, HHVM, a web server, and any
other server software on your local machine. No
more worrying about messing up your operating
system! Vagrant boxes are completely disposable.
If something goes wrong, you can destroy and re-
create the box in minutes!”
What’s in the box:
• Ubuntu 14.04
• PHP 5.6
• HHVM
• Nginx
• MySQL
• Postgres
• Redis
• NodeJS
• Bower
• Grunt
• Gulp
• Beanstalkd
• Memcached
• Laravel Envoy
Fabric + HipChat Extension + more!
Getting Homestead
Install the box:
vagrant box add laravel/homestead
Getting Homestead
If you have PHP installed locally:
composer global require "laravel/homestead=~2.0"
Make sure to place the ~/.composer/vendor/bin directory in your
PATH so the homestead executable is found when you run the
homestead command in your terminal.
Homestead 2.0
Significant change over previous 1.x versions
Uses homestead from your home folder
Less vagrant stuff in your projects (if you don’t like that
sort of thing)
How I use Homestead
https://github.com/svpernova09/HomesteadSkeleton
Drop in Homestead files to project
Each project has an isolated vagrant environment
Easier to share dev environment settings

Contenu connexe

Tendances

Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Viral Solani
 
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialAdventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialJoe Ferguson
 
All the Laravel Things – Up & Running to Making $$
All the Laravel Things – Up & Running to Making $$All the Laravel Things – Up & Running to Making $$
All the Laravel Things – Up & Running to Making $$Joe Ferguson
 
A introduction to Laravel framework
A introduction to Laravel frameworkA introduction to Laravel framework
A introduction to Laravel frameworkPhu Luong Trong
 
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)Roes Wibowo
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the CloudJoe Ferguson
 
php[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground UpJoe Ferguson
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5Darren Craig
 
10 Laravel packages everyone should know
10 Laravel packages everyone should know10 Laravel packages everyone should know
10 Laravel packages everyone should knowPovilas Korop
 
Getting to know Laravel 5
Getting to know Laravel 5Getting to know Laravel 5
Getting to know Laravel 5Bukhori Aqid
 
Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?John Blackmore
 
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Vikas Chauhan
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 

Tendances (20)

Why Laravel?
Why Laravel?Why Laravel?
Why Laravel?
 
Laravel 5.4
Laravel 5.4 Laravel 5.4
Laravel 5.4
 
Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
 
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 TutorialAdventures in Laravel 5 SunshinePHP 2016 Tutorial
Adventures in Laravel 5 SunshinePHP 2016 Tutorial
 
All the Laravel Things – Up & Running to Making $$
All the Laravel Things – Up & Running to Making $$All the Laravel Things – Up & Running to Making $$
All the Laravel Things – Up & Running to Making $$
 
A introduction to Laravel framework
A introduction to Laravel frameworkA introduction to Laravel framework
A introduction to Laravel framework
 
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
php[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Up
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
10 Laravel packages everyone should know
10 Laravel packages everyone should know10 Laravel packages everyone should know
10 Laravel packages everyone should know
 
Getting to know Laravel 5
Getting to know Laravel 5Getting to know Laravel 5
Getting to know Laravel 5
 
Presentation laravel 5 4
Presentation laravel 5 4Presentation laravel 5 4
Presentation laravel 5 4
 
Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?
 
Laravel overview
Laravel overviewLaravel overview
Laravel overview
 
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1
 
Workshop Laravel 5.2
Workshop Laravel 5.2Workshop Laravel 5.2
Workshop Laravel 5.2
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 

En vedette

From CakePHP to Laravel
From CakePHP to LaravelFrom CakePHP to Laravel
From CakePHP to LaravelJason McCreary
 
Laravel : A Fastest Growing Kid
Laravel : A Fastest Growing KidLaravel : A Fastest Growing Kid
Laravel : A Fastest Growing KidEndive Software
 
1 electronic data interchange (edi)
1   electronic data interchange (edi)1   electronic data interchange (edi)
1 electronic data interchange (edi)gauravashq
 
Domain Driven Design using Laravel
Domain Driven Design using LaravelDomain Driven Design using Laravel
Domain Driven Design using Laravelwajrcs
 
ELECTRONIC DATA INTERCHANGE
ELECTRONIC DATA INTERCHANGE ELECTRONIC DATA INTERCHANGE
ELECTRONIC DATA INTERCHANGE alraee
 
Advantages and Disadvantages of Technology
Advantages and Disadvantages of TechnologyAdvantages and Disadvantages of Technology
Advantages and Disadvantages of Technology09356506910
 
Introduction à Laravel 4 @Dogstudio
Introduction à Laravel 4 @DogstudioIntroduction à Laravel 4 @Dogstudio
Introduction à Laravel 4 @DogstudioNicolas Widart
 
PHP 7.0 : aperçu des nouveautés
PHP 7.0 : aperçu des nouveautésPHP 7.0 : aperçu des nouveautés
PHP 7.0 : aperçu des nouveautésDidcode
 

En vedette (12)

From CakePHP to Laravel
From CakePHP to LaravelFrom CakePHP to Laravel
From CakePHP to Laravel
 
Laravel : A Fastest Growing Kid
Laravel : A Fastest Growing KidLaravel : A Fastest Growing Kid
Laravel : A Fastest Growing Kid
 
Intro to Laravel 4
Intro to Laravel 4Intro to Laravel 4
Intro to Laravel 4
 
Laravel 5
Laravel 5Laravel 5
Laravel 5
 
Laravel 5
Laravel 5Laravel 5
Laravel 5
 
1 electronic data interchange (edi)
1   electronic data interchange (edi)1   electronic data interchange (edi)
1 electronic data interchange (edi)
 
Laravel 5 and SOLID
Laravel 5 and SOLIDLaravel 5 and SOLID
Laravel 5 and SOLID
 
Domain Driven Design using Laravel
Domain Driven Design using LaravelDomain Driven Design using Laravel
Domain Driven Design using Laravel
 
ELECTRONIC DATA INTERCHANGE
ELECTRONIC DATA INTERCHANGE ELECTRONIC DATA INTERCHANGE
ELECTRONIC DATA INTERCHANGE
 
Advantages and Disadvantages of Technology
Advantages and Disadvantages of TechnologyAdvantages and Disadvantages of Technology
Advantages and Disadvantages of Technology
 
Introduction à Laravel 4 @Dogstudio
Introduction à Laravel 4 @DogstudioIntroduction à Laravel 4 @Dogstudio
Introduction à Laravel 4 @Dogstudio
 
PHP 7.0 : aperçu des nouveautés
PHP 7.0 : aperçu des nouveautésPHP 7.0 : aperçu des nouveautés
PHP 7.0 : aperçu des nouveautés
 

Similaire à Laravel 5 New Features

Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Dilouar Hossain
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravelConfiz
 
Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)
Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)
Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)ssuser337865
 
Web service with Laravel
Web service with LaravelWeb service with Laravel
Web service with LaravelAbuzer Firdousi
 
laravel-interview-questions.pdf
laravel-interview-questions.pdflaravel-interview-questions.pdf
laravel-interview-questions.pdfAnuragMourya8
 
Laravel presentation
Laravel presentationLaravel presentation
Laravel presentationToufiq Mahmud
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmersjphl
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxSaziaRahman
 
Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2Shahrzad Peyman
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Laravel and artisan cli
Laravel and artisan cliLaravel and artisan cli
Laravel and artisan cliSayed Ahmed
 
introduction to web programming using PHP
introduction to web programming using PHPintroduction to web programming using PHP
introduction to web programming using PHPvishnupriyapm4
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Mack Hardy
 
Hidden things uncovered about laravel development
Hidden things uncovered about laravel developmentHidden things uncovered about laravel development
Hidden things uncovered about laravel developmentKaty Slemon
 
Php Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerPhp Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerJackson F. de A. Mafra
 

Similaire à Laravel 5 New Features (20)

Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravel
 
Laravel 5
Laravel 5Laravel 5
Laravel 5
 
Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)
Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)
Laravel (8) php_framework_handbook__start_from_zer_18604872_(z-lib.org)
 
Web service with Laravel
Web service with LaravelWeb service with Laravel
Web service with Laravel
 
laravel-interview-questions.pdf
laravel-interview-questions.pdflaravel-interview-questions.pdf
laravel-interview-questions.pdf
 
Laravel 5.3 - Web Development Php framework
Laravel 5.3 - Web Development Php frameworkLaravel 5.3 - Web Development Php framework
Laravel 5.3 - Web Development Php framework
 
cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)
 
Laravel presentation
Laravel presentationLaravel presentation
Laravel presentation
 
Getting started with laravel
Getting started with laravelGetting started with laravel
Getting started with laravel
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmers
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptx
 
Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2Object Oriented Programming with Laravel - Session 2
Object Oriented Programming with Laravel - Session 2
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Laravel and artisan cli
Laravel and artisan cliLaravel and artisan cli
Laravel and artisan cli
 
Phalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil ConferencePhalcon 2 - PHP Brazil Conference
Phalcon 2 - PHP Brazil Conference
 
introduction to web programming using PHP
introduction to web programming using PHPintroduction to web programming using PHP
introduction to web programming using PHP
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
Hidden things uncovered about laravel development
Hidden things uncovered about laravel developmentHidden things uncovered about laravel development
Hidden things uncovered about laravel development
 
Php Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant KillerPhp Conference Brazil - Phalcon Giant Killer
Php Conference Brazil - Phalcon Giant Killer
 

Plus de Joe Ferguson

Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Joe Ferguson
 
Modern infrastructure as code with ansible PyTN
Modern infrastructure as code with ansible  PyTNModern infrastructure as code with ansible  PyTN
Modern infrastructure as code with ansible PyTNJoe Ferguson
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sinkJoe Ferguson
 
Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™Joe Ferguson
 
DevSpace Conf 2017 - Making sense of the provisioning circus
DevSpace Conf 2017 - Making sense of the provisioning circusDevSpace Conf 2017 - Making sense of the provisioning circus
DevSpace Conf 2017 - Making sense of the provisioning circusJoe Ferguson
 
Release and-dependency-management memphis python
Release and-dependency-management memphis pythonRelease and-dependency-management memphis python
Release and-dependency-management memphis pythonJoe Ferguson
 
Composer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementComposer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementJoe Ferguson
 
Put an end to regression with codeception testing
Put an end to regression with codeception testingPut an end to regression with codeception testing
Put an end to regression with codeception testingJoe Ferguson
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamJoe Ferguson
 
Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:win Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:win Joe Ferguson
 
Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:winConsole Apps: php artisan forthe:win
Console Apps: php artisan forthe:winJoe Ferguson
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016Joe Ferguson
 
So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...Joe Ferguson
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Joe Ferguson
 
Madison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsMadison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsJoe Ferguson
 
ZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small TeamsZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small TeamsJoe Ferguson
 
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello ProductionZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
Secure Form Processing and Protection - Devspace 2015
Secure Form Processing and Protection - Devspace 2015 Secure Form Processing and Protection - Devspace 2015
Secure Form Processing and Protection - Devspace 2015 Joe Ferguson
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Joe Ferguson
 
Continuous Integration: How I stopped guessing if that merge was bad
Continuous Integration: How I stopped guessing if that merge was badContinuous Integration: How I stopped guessing if that merge was bad
Continuous Integration: How I stopped guessing if that merge was badJoe Ferguson
 

Plus de Joe Ferguson (20)

Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021
 
Modern infrastructure as code with ansible PyTN
Modern infrastructure as code with ansible  PyTNModern infrastructure as code with ansible  PyTN
Modern infrastructure as code with ansible PyTN
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sink
 
Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™Throwing Laravel into your Legacy App™
Throwing Laravel into your Legacy App™
 
DevSpace Conf 2017 - Making sense of the provisioning circus
DevSpace Conf 2017 - Making sense of the provisioning circusDevSpace Conf 2017 - Making sense of the provisioning circus
DevSpace Conf 2017 - Making sense of the provisioning circus
 
Release and-dependency-management memphis python
Release and-dependency-management memphis pythonRelease and-dependency-management memphis python
Release and-dependency-management memphis python
 
Composer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementComposer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency Management
 
Put an end to regression with codeception testing
Put an end to regression with codeception testingPut an end to regression with codeception testing
Put an end to regression with codeception testing
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small team
 
Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:win Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:win
 
Console Apps: php artisan forthe:win
Console Apps: php artisan forthe:winConsole Apps: php artisan forthe:win
Console Apps: php artisan forthe:win
 
So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016So You Just Inherited a $Legacy Application… NomadPHP July 2016
So You Just Inherited a $Legacy Application… NomadPHP July 2016
 
So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...So You Just Inherited a $Legacy Application...
So You Just Inherited a $Legacy Application...
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
 
Madison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsMadison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small Teams
 
ZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small TeamsZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small Teams
 
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello ProductionZendCon 2015 - Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
 
Secure Form Processing and Protection - Devspace 2015
Secure Form Processing and Protection - Devspace 2015 Secure Form Processing and Protection - Devspace 2015
Secure Form Processing and Protection - Devspace 2015
 
Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015 Acceptance & Functional Testing with Codeception - Devspace 2015
Acceptance & Functional Testing with Codeception - Devspace 2015
 
Continuous Integration: How I stopped guessing if that merge was bad
Continuous Integration: How I stopped guessing if that merge was badContinuous Integration: How I stopped guessing if that merge was bad
Continuous Integration: How I stopped guessing if that merge was bad
 

Dernier

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 

Dernier (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

Laravel 5 New Features

  • 1. Laravel 5 New Features Joe Ferguson
  • 2. Before we begin Have Virtualbox (virtualbox.org) Installed Have VirtualBox Extension Pack Installed Have Vagrant (vagrantup.com) Installed run: vagrant box add laravel/homestead
  • 4. Laravel 5 Directory App directory now "Your Application" / "Entry point to app” Laravel 4 Artisan Commands -> Console in App folder Web stuff in Http Controllers all have name space filters.php -> Broken out into separate classes/files. More focus on Service Providers -> Filter Service Providers No more global.php -> Use service providers Removed models directory. Can be just in app folder. PSR-4 default Don't like the app namespace? artisan app:name MyApplication
  • 5. Blade Changes Laravel 4 uses {{ to echo and {{{ To echo escaped Laravel 5 {{ and {{{ will echo escaped and {!! is used to echo raw Biggest impact is likely form helpers: {!! Form::open() !!}
  • 6. Commands Commands (app/Commands) - Message containing only info needed to do something Command Handler (app/Handlers/Commands) - Class that does something in response to a command Command Bus - Allows dispatch of commands, matches commands to handlers Self handling commands just need a handle() method on the command & implements SelfHandling
  • 7. Events Events (app/Events) Events have handlers (similar to Commands) Bind Events via appProvidersEventServiceProvider.php Events inform the system something happened VS demanding action from the system
  • 8. Form Requests Special class for validating and authorizing form submissions Each class has rules() (returns array) and authorize() (returns boolean) methods Benefit of rules & authorize being methods is you can perform logic Type Hinting your forms to the Form Request will automatically validate your forms If validation fails, errors will be available to the view and redirected back. This happens because the FormRequestServiceProvider listens for anything being resolved is instance of FormRequest and calls the validate method.
  • 9. Helpers view() - Get a View instance for the given view path action() - Generate a URL for a given controller action app_path() - Get the fully qualified path to the app directory asset() - Generate a URL for an asset. Routing – get(), delete(), put()
  • 10. Route Caching artisan route:cache Serializes your routes.php Benefits: Faster routing Drawback: Must run artisan route:clear on every routes.php change
  • 11. Middleware Implements decorator pattern. request -> does work -> returns object to next layer Laravel uses middleware for Encrypting/Decrypting cookies, Reading/Writing Sessions artisan make:middleware MyMiddleware (app/Http/Middleware) Middleware registered in app/Http/Kernel.php Can run before or after the request has been processed. Easiest example would be auth
  • 12. Controller Method Injection Can inject dependencies into methods, no longer via constructor Purpose is to help developers write cleaner code
  • 13. Changes to Illuminate Packages Form or HTML helpers no longer in Core, must be pulled in via composer. add "laravelcollective/html": "~5.0" to composer update config/app.php
  • 14. Elixir API for defining basic Gulp tasks for your app. Requires nodejs Put your sass/less files in resources/assets/sass|less Can trigger sass/less/phpunit/phpspec, combine stylesheets
  • 15. Socialite Easy to use social logins with oauth Supports Facebook, Twitter, Google, Github, and Bitbucket
  • 16. Contracts Set of interfaces that define the core services provided by the framework Depend on abstractions, not concrete dependencies. Write code that doesn't have to be aware of the laravel framework
  • 17. Upgrade from 4.2 to 5 Fresh install Laravel 5 Update Dependencies /Packages Namespace (somewhat optional for now) Migrate environment variables Move routes to app/Http/routes.php Move controllers to app/Http/Controllers (add this to classmap) Copy route bindings to boot() in app/Providers/RouteServiceProvider.php Add route facade to RouteServiceProvider.php to continue using Route facade CSRF is now global. Use middleware to disable if needed Move models to app/Models. Add app/Models to classmap in composer.json Update your user auth to use Laravel 5’s auth system Move commands to app/Console/Commands. Add app/Console/Commands to classmap in composer.json Move migrations to database/migrations, Database Seeds to database/seeds … and more!
  • 18. Upgrade from 4.2 to 5 http://laravel.com/docs/5.0/upgradeFresh install Laravel 5 Update Dependencies /Packages Namespace (somewhat optional for now) Migrate environment variables Move routes to app/Http/routes.php Move controllers to app/Http/Controllers (add this to classmap) Copy route bindings to boot() in app/Providers/RouteServiceProvider.php Add route facade to RouteServiceProvider.php to continue using Route facade CSRF is now global. Use middleware to disable if needed Move models to app/Models. Add app/Models to classmap in composer.json Update your user auth to use Laravel 5’s auth system Move commands to app/Console/Commands. Add app/Console/Commands to classmap in composer.json Move migrations to database/migrations, Database Seeds to database/seeds … and more!
  • 19. Homestead “Laravel Homestead is an official, pre-packaged Vagrant "box" that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re- create the box in minutes!”
  • 20. What’s in the box: • Ubuntu 14.04 • PHP 5.6 • HHVM • Nginx • MySQL • Postgres • Redis • NodeJS • Bower • Grunt • Gulp • Beanstalkd • Memcached • Laravel Envoy Fabric + HipChat Extension + more!
  • 21. Getting Homestead Install the box: vagrant box add laravel/homestead
  • 22. Getting Homestead If you have PHP installed locally: composer global require "laravel/homestead=~2.0" Make sure to place the ~/.composer/vendor/bin directory in your PATH so the homestead executable is found when you run the homestead command in your terminal.
  • 23. Homestead 2.0 Significant change over previous 1.x versions Uses homestead from your home folder Less vagrant stuff in your projects (if you don’t like that sort of thing)
  • 24. How I use Homestead https://github.com/svpernova09/HomesteadSkeleton Drop in Homestead files to project Each project has an isolated vagrant environment Easier to share dev environment settings