SlideShare a Scribd company logo
1 of 86
Download to read offline
LARAVEL 5
Darren Craig
@minusdarren
@minusdarren
Introduction
Darren Craig
CTO - @minus40co
โ˜… Built my ๏ฌrst website in 1998
โ˜… Hosted on FortuneCity
โ˜… Developing in PHP for over 10 years
โ˜… Superstar DJ
โ€ฆ in Microsoft Word
(ish)
Caveats
โ˜… Code is an example only - not best practiceโ€ฆ
โ˜… โ€ฆor consistent!
โ˜… Mix of basic and advanced ideas
โ˜… Please ask questions!
โ˜… More than one way to skin a cat
Overview
What is Laravel?
โ˜… PHP Framework
โ˜… V1 was released in 2011
โ˜… Taylor Otwell (@taylorotwell)
โ˜… V5 released in February 2015
โ˜… Laracon - Annual conferences in EU & US
Why are you talking about it?
โ˜… Using Laravel since v3
โ˜… Excellent Framework
โ˜… Striving for better & more robust applications
โ˜… Laravel helping lead the charge
โ˜… PSR-4
โ˜… Contracts/Interfaces
โ˜… Command Bus
โ˜… SOLID principles
โ˜… Community - DDD, Testing, Event Sourcing
Under the hood
โ˜… Uses Composer (http://getcomposer.org)
โ˜… >= PHP 5.4
โ˜… Leverages lots of Symfony components
โ˜… Artisan CLI
โ˜… Eloquent ORM
Included Tools
PHPSpec
โ˜… Testing library
โ˜… Uses โ€œDesign by Speci๏ฌcationโ€
class EmailAddressSpec
{
public function it_validates_the_email()
{
$this->shouldThrow('Exception')->during('__construct', ['InvalidEmail.com'])
}
public function it_normalizes_the_address()
{
$this->beConstructedWith('StrangeCASE@EmailAddress.com');
$this->getEmail()->shouldReturn('strangecase@emailaddress.com');
}
}
vendor/bin/phpspec describe EmailAddress
vendor/bin/phpspec run
PHPSpec
class EmailAddress
{
private $email;
public function __construct($email)
{
if( !filter_var($email, FILTER_VALIDATE_EMAIL) ) throw new Exception;
$this->email = strtolower($email);
}
public function getEmail()
{
return $this->email;
}
}
Elixir
โ˜… Wrapper for GulpJS
var elixir = require('laravel-elixir');
elixir(function(mix)
{
mix.less('app.less');
mix.styles([
"normalize.css",
"main.css"
], 'public/build/css/everything.css');
mix.version(["css/all.css", "js/app.js"]);
});
href=โ€œ/css/all-16d570a7.cssโ€œ><link rel="stylesheet" href="{{ elixir("css/all.css") }}">
Directory Structure
Directory Structure
โ˜… Con๏ฌg, DB, Views
moved above the app
directory
โ˜… New directories within
app/
โ˜… No โ€œmodelsโ€ directory
โ˜… Leverages PSR-4
autoloadingโ€จ
(http://www.php-
๏ฌg.org/psr/psr-4/)
โ˜… App/ namespace =
app/ folder
php artisan app:name Acme
Directory Structure
app
Commands
Console
Events
Handlers
Commands
Events
Http
Controllers
Middleware
Requests
Providers
Services
bootstrap
config
database
migrations
seeds
public
package
resources
lang
views
storage
cache
logs
meta
sessions
views
work
tests
Service Providers
โ˜… Bootstrap/con๏ฌgure classes in your application
โ˜… app/Providers
โ˜… AppServiceProvider.php
โ˜… BusServiceProvider.php
โ˜… Con๏ฌgServiceProvider.php
โ˜… EventServiceProvider.php
โ˜… RouteServiceProvider.php
โ˜… Referenced in con๏ฌg/app.php
Routes โ€™n Things
Routing
โ˜… Routes moved to app/Http/routes.php
โ˜… RESTful routes
โ˜… No namespace necessary!
Route::get(โ€˜/', 'WelcomeController@index');
$router->get(โ€˜/','WelcomeController@index');
Route::get(โ€ฆ);
Route::post(โ€ฆ);
Route::put(โ€ฆ);
Route::patch(โ€ฆ);
Route::delete(โ€ฆ);
Routing
โ˜… Route Variables
Route::get('video/{video}', โ€˜VideoController@show');
Route::get('/video/{video}/comments/{comment}', 'VideoCommentsController@show');
// VideoController
public function show($videoId) {}
// VideoCommentsController
public function show($videoId, $commendId) {}
โ˜… Resource Routes
Route::resource('video', 'VideoController');
@index
@show
@create
@store
@edit
@update
@delete
Routing
โ˜… Implicit Controllers
Route::controller('videos', โ€˜VideoController');
class VideoController extends Controller
{
public function getIndex() {} // GET videos
public function postProfile() {} // POST videos/profile
public function anyAction() {} // ANY videos/action
}
RouteServiceProvider
class RouteServiceProvider extends ServiceProvider {
protected $namespace = โ€˜AppHttpControllers';
public function map(Router $router)
{
$router->group(['namespace' => $this->namespace], function($router)
{
require app_path('Http/routes.php');
});
}
}
Route Cache
โ˜… Resolves and caches your routes ๏ฌle
โ˜… Drastically speeds up applications with lots of
routes
php artisan route:cache
Eloquent
Eloquent
โ˜… Laravelโ€™s own Active Record implementation
โ˜… Beautifully expressive syntax
โ˜… Allows you to easily query and update your database
โ˜… Has drivers for MySQL, SQLite, Postgres, SQL Server
and Redis out of the box.
โ˜… Lots of packages available for DB support
Eloquent
class User extends Model {
public function comments()
{
return $this->hasMany('Comment');
}
}
$user = User::all();
$user = User::find(1);
$user = User::where('name', =, $name)->first();
$user = User::where('age', <, 18)->get();
$user = User::with('comments')->get();
@foreach($user->comments as $comment)
<li>{{ $comment->body }}</li>
@endforeach
Eloquent N+1 Problem
// 1 query per comment
$user = User::first();
@foreach($user->comments as $comment)
<li>{{ $comment->body }}</li>
@endforeach
// 1 query total
$user = User::with('comments')->first();
@foreach($user->comments as $comment)
<li>{{ $comment->body }}</li>
@endforeach
IoC Container
IoC Container
class UserController
{
public function getProfile()
{
$facebook = new Facebook(['appId' => 123, 'secret' => 'cohaaagan']);
$user = $facebook->getUser();
}
public function getFriends()
{
$facebook = new Facebook(['appId' => 123, 'secret' => 'cohaaagan']);
$friends = $facebook->getFriends();
}
}
IoC Container
class FooController
{
private $facebook;
public function __construct()
{
$this->facebook = new Facebook(['appId' => 123, 'secret' => 'cohaaagan']);
}
}
class BarController
{
private $facebook;
public function __construct()
{
$this->facebook = new Facebook(['appId' => 123, 'secret' => 'cohaaagan']);
}
}
IoC Container
class AppServiceProvider extends ServiceProvider {
public function register() {
$this->app->bind('Facebook', function() {
return new Facebook(['appId' => 123, 'secret' => 'cohaaagan']);
});
}
}
โ˜… You can โ€˜tellโ€™ Laravel to provide a fully instantiated class
instead of the requested class
IoC Container
class FooController {
private $facebook;
public function __construct() {
$this->facebook = App::make('Facebook');
}
}
class FooController {
private $facebook;
public function __construct(Facebook $facebook) {
$this->facebook = $facebook;
}
}
Contracts
Contracts
โ˜… Also known as โ€œInterfacesโ€
โ˜… De๏ฌne the โ€˜Public APIโ€™ of your classes
โ˜… Packaged as part of L5
โ˜… One for each of the the core Laravel services
โ˜… Help you โ€˜decoupleโ€™ your code
Contracts
class UserController
{
public function __construct(SomeVendorMailGun $mail) {
$this->mail = $mail;
}
public function registerUser() {
$this->mail->send(...);
}
}
โ˜… โ€œTightly coupledโ€
โ˜… What would happen if we changed from MailGun
to Mandrill, or Gmail?
Contracts
namespace IlluminateContractsMail;
interface Mailer {
public function raw($text, $callback);
public function send($view, array $data, $callback);
public function failures();
}
class UserController
{
public function __construct(IlluminateContractsMailMailer $mail) {
$this->mail = $mail;
}
public function registerUser() {
$this->mail->send(...);
}
}
Contracts
use IlluminateContractsMailMailer;
class FacebookMailer implements Mailer
{
public function raw($text, $callback) {};
public function send($view, array $data, $callback) {};
public function failures() {};
}
class AppServiceProvider extends ServiceProvider {
public function register() {
$this->app->bind('IlluminateContractsMailMailer', function() {
return new FacebookMailer();
});
}
}
Contracts
class UserController
{
public function __construct(IlluminateContractsMailMailer $mail) {
$this->mail = $mail;
}
public function registerUser() {
$this->mail->send(...);
}
}
class AppServiceProvider extends ServiceProvider {
public function register() {
$this->app->bind('IlluminateContractsMailMailer', function() {
return new TwitterMailer();
});
}
}
File Drivers
File Drivers
โ˜… Improved version of the previous Filesystem class
โ˜… Now powered by Flysystem
(๏ฌ‚ysystem.thephpleague.com)
โ˜… Allows for local & remote ๏ฌlesystems at the same
time
โ˜… Compatible with S3 & Rackspace
โ˜… Support available for lots of others
composer require league/flysystem-aws-s3-v2 ~1.0
composer require league/flysystem-rackspace ~1.0
File Drivers - Con๏ฌguration
// config/filesystems.php
return [
'default' => 'local',
'cloud' => 's3',
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path().'/app',
],
's3' => [
'driver' => 's3',
'key' => 'your-key',
'secret' => 'your-secret',
'region' => 'your-region',
'bucket' => 'your-bucket',
],
'rackspace' => [
'driver' => 'rackspace',
'username' => 'your-username',
'key' => 'your-key',
'container' => 'your-container',
'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
'region' => 'IAD',
],
],
];
File Drivers - Usage
$disk = Storage::disk('cloud');
$disk = Storage::disk('local');
$disk = Storage::disk('s3');
$exists = Storage::disk('s3')->exists('file.jpg');
$exists = $disk->exists('file.jpg');
$file = Storage::get('file.jpg');
Storage::put('file.jpg', $contents);
Storage::prepend('file.log', 'Prepended Text');
Storage::append('file.log', 'Appended Text');
Storage::delete('file.jpg');
Storage::delete(['file1.jpg', 'file2.jpg']);
Storage::copy('old/file1.jpg', 'new/file1.jpg');
Method Injection
Method Injection
โ˜… Uses the IoC container to resolve dependencies
injected directly into a method.
โ˜… Helps cut down on cluttered constructor methods
class UserController {
public function registerUser(Mailer $mail) {
// do some registration stuff
$mail->send();
}
// Route::post('user/{id}/mail', 'UserController@mailUser');
public function mailUser($userId, Mailer $mail) {
// do some registration stuff
$mail->send();
}
}
Form Requests
Form Requests
โ˜… Aim to standardise and simplify form validation
โ˜… Validation in V3/4 was verbose:
class UserController
{
public function register()
{
$rules = [
'name' => 'required',
'email' => 'email|required'
];
$validator = Validator::make(Input::all(), $rules);
if($validator->fails()) return redirect()->back()->withErrors();
// validation passed, do something...
}
}
Form Requests
โ˜… Form requests make things very cleanโ€ฆ
class UserController
{
public function register(RegisterUserRequest $request)
{
// validation passed, do something...
}
}
โ˜… Automatically validates
โ˜… Automatically redirects back, with errors
Form Requests
โ˜… How to generate a request
php artisan make:request RegisterUserRequest
โ˜… Stored in app/Http/Requests
class RegisterUserRequest extends Request {
public function authorize() {
return false;
}
public function rules() {
return [
'name' => 'required',
'email' => 'email|required'
];
}
}
Forms & HTML Helpers
โ˜… Uses an expressive syntax to generate form ๏ฌelds
& HTML entities
โ˜… Removed from L5 as default
โ˜… Available as a composer package
composer require illuminate/html ~5.0
Middleware
Middleware
โ˜… Route Decorators
โ˜… Similar to ๏ฌlters (still available)
โ˜… Executed before the logic of your application
Middleware
โ˜… Stored in app/Http/Middleware:
โ˜… Authenticate
โ˜… RedirectIfAuthenticated
โ˜… VerifyCSRFToken
โ˜… Easy to add your own
php artisan make:middleware WhitelistedIP
Middleware
class WhitelistedIP {
$ipWhitelist = [
'123.123.123.123'
];
public function handle($request, Closure $next)
{
if(!in_array($request->getClientIp(), $this->ipWhitelist))
{
return redirect('/');
}
return $next($request);
}
}
โ€œAfterโ€ Middleware
class DoSomethingAfter {
public function handle($request, Closure $next)
{
$response = $next($request);
// Perform action
return $response;
}
}
Middleware
<?php namespace AppHttp;
use IlluminateFoundationHttpKernel as HttpKernel;
class Kernel extends HttpKernel {
protected $middleware = [
'IlluminateFoundationHttpMiddlewareCheckForMaintenanceMode',
'IlluminateCookieMiddlewareEncryptCookies',
'IlluminateCookieMiddlewareAddQueuedCookiesToResponse',
'IlluminateSessionMiddlewareStartSession',
'IlluminateViewMiddlewareShareErrorsFromSession',
'AppHttpMiddlewareVerifyCsrfToken',
'AppHttpMiddlewareWhitelistedIP'
];
protected $routeMiddleware = [
'auth' => 'AppHttpMiddlewareAuthenticate',
'auth.basic' => 'IlluminateAuthMiddlewareAuthenticateWithBasicAuth',
'guest' => 'AppHttpMiddlewareRedirectIfAuthenticated',
'whitelisted' => 'AppHttpMiddlewareWhitelistedIP',
];
}
Applying Route Middleware
Route::group('admin/*', ['middleware' => 'whitelisted', function()
{
// protected
}]);
class UserController extends Controller {
public function __construct()
{
$this->middleware('auth');
$this->middleware('log', ['only' => ['fooAction', 'barAction']]);
$this->middleware('subscribed', ['except' => ['fooAction', 'barAction']]);
}
}
Cron & Scheduling
Cron & Scheduling
15 6 2 1 * /home/melissa/backup.sh
17 6 2 1 * /home/carl/hourly-archive.sh
19 6 2 1 * /sites/my-site/artisan command:run
30 6 2 1 * /sites/my-site/artisan arnie:gettothechopper
Laravelโ€™s Scheduler
// app/Console/Kernel.php
class Kernel extends ConsoleKernel {
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')->hourly();
$schedule->command('foo')->everyFiveMinutes();
$schedule->command('foo')->everyThirtyMinutes();
$schedule->exec('composer self-update')->daily();
$schedule->command('foo')->weekdays();
$schedule->command('foo')->mondays();
$schedule->command(โ€˜foo')->sendOutputTo($filePath)
->emailOutputTo('foo@example.com');
}
}
* * * * * php /path/to/artisan schedule:run 1>> /dev/null 2>&1
Command Bus
Command Bus
โ˜… Separates the logic of you application into small,
manageable actions
โ˜… Creates reusable classes that can be used from
different access points to your application
โ˜… Helps keep your code DRY
โ˜… Helps make your code testable
Command Bus
[ request ]
[ command ]
[ bus ]
[ handler ]
Command Bus
[ request ]
[ command ]
[ bus ]
[ handler ]
A data transfer object, or message, which
contains only the information required for
carrying out a speci๏ฌc action
Matches a command to the corresponding
handler and executes it
Responsible for carrying out the โ€˜taskโ€™ in
response to the command.
Command Bus
[ request ]
[ command ]
[ bus ]
[ handler ]
POST
/user/register
RegisterUser
RegisterUserHandler
POST
/user/updatePassword
UpdateUserPassword
UpdateUserPasswordHandler
Creating a command
class RegisterUser extends Command
{
public $name;
public $email;
public $password;
public function __construct($name, $email, $password)
{
$this->name = $name;
$this->email = $email;
$this->password = $password;
}
}
php artisan make:command RegisterUser
app/Commands/RegisterUser.php
Dispatching the command
class UserController extends Controller {
use DispatchesCommands;
public function postRegister(RegisterUserRequest $request)
{
$this->dispatch(new RegisterUser(
$request->get('name'),
$request->get('email'),
$request->get('password')
));
// OR
$this->dispatchFrom(RegisterUser::class, $request);
}
}
The Command Handler
class RegisterUserHandler
{
public function handle(RegisterUser $command)
{
$user = User::create([
'name' => $command->name,
'email' => $command->email,
'password' => Hash::make('password')
]);
}
}
php artisan handler:command RegisterUserHandler
Creating a command
class UpdateUserPassword extends Command
{
public $userId;
public $password;
public function __construct($userId, $password)
{
$this->userId = $userId;
$this->password = $password;
}
}
php artisan make:command UpdateUserPassword
app/Commands/UpdateUserPassword.php
The Command Handler
class UpdateUserPasswordHandler
{
public function handle(RegisterUser $command)
{
$user = User::find($command->userId);
$user->updatePassword(
Hash::make($command->password)
);
}
}
php artisan handler:command UpdateUserPasswordHandler
Queued Commands
php artisan make:command ExampleQueuedCommand --queued
use IlluminateQueueSerializesModels;
use IlluminateQueueInteractsWithQueue;
use IlluminateContractsQueueShouldBeQueued;
class ExampleQueuedCommand extends Command implements ShouldBeQueued
{
use InteractsWithQueue, SerializesModels;
public function __construct()
{
//
}
}
Events
Events
โ˜… Also known as the Publish-Subscribe pattern
โ˜… Used to model concerns of the application youโ€™re
building
โ˜… Work in a similar way to Commands
Generating An Event
php artisan make:event UserWasRegistered
use AppEventsEvent;
use IlluminateQueueSerializesModels;
class UserWasRegistered extends Event {
use SerializesModels;
public $user;
public function __construct(User $user)
{
$this->user = $user;
}
}
app/EventsUserWasRegistered.php
The Event Handler
class SendRegistrationConfirmation {
public function __construct()
{
//
}
public function handle(UserWasRegistered $event)
{
// send mail
}
}
php artisan handler:event SendRegistrationConfirmation --event=UserWasRegistered
Registering Events
class EventServiceProvider extends ServiceProvider {
protected $listen = [
UserWasRegistered::class => [
SendRegistrationConfirmation::class,
GenerateHolidayEntitlement::class,
SetServerPermissions::class,
NotifyCurrentEmployees::class
]
];
}
app/Providers/EventServiceProvider.php
Firing Events
class RegisterUserHandler
{
public function handle(RegisterUser $command)
{
// register the user $user
Event::fire(new UserWasRegistered($user));
}
}
app/Handlers/Commands/RegisterUserHandler.php
Optional Packages
Optional Packages
โ˜… Socialite
โ˜… Provides a consistent interface for
authentication using social networks
โ˜… Returns a consistent user object & API to get
name, email, avatar, etc
composer require "laravel/socialite": "~2.0"
Optional Packages
โ˜… Cashier
โ˜… Provides a ๏ฌ‚uent interface for Stripe
โ˜… Handles creating/modifying subscriptions,
recurring charges, free trials, failed payments
and invoices
composer require "laravel/cashier": "~3.0"
Learning More
Learning Laravel
โ˜… Laravel Docs (http://laravel.com/docs)
โ˜… Laracasts (http://laracasts.com)
โ˜… Twitter @laravelphp
โ˜… IRC
โ˜… #Laravel
โ˜… #Dev-Discussions
Phew! Questions?
Thanks! Pints?
@minusdarren

More Related Content

What's hot

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
ย 
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
ย 
Knowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkKnowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkBukhori Aqid
ย 
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
ย 
A introduction to Laravel framework
A introduction to Laravel frameworkA introduction to Laravel framework
A introduction to Laravel frameworkPhu Luong Trong
ย 
All Aboard for Laravel 5.1
All Aboard for Laravel 5.1All Aboard for Laravel 5.1
All Aboard for Laravel 5.1Jason McCreary
ย 
Laravel 5 New Features
Laravel 5 New FeaturesLaravel 5 New Features
Laravel 5 New FeaturesJoe Ferguson
ย 
10 Laravel packages everyone should know
10 Laravel packages everyone should know10 Laravel packages everyone should know
10 Laravel packages everyone should knowPovilas Korop
ย 
Laravel.IO A Use-Case Architecture
Laravel.IO A Use-Case ArchitectureLaravel.IO A Use-Case Architecture
Laravel.IO A Use-Case ArchitectureShawn McCool
ย 
Laravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingLaravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingChristopher Pecoraro
ย 
Laravel 5
Laravel 5Laravel 5
Laravel 5Brian Feaver
ย 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel frameworkAhmad Fatoni
ย 
Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.SWAAM Tech
ย 
MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5 MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5 Joe Ferguson
ย 
Laravel 5.4
Laravel 5.4 Laravel 5.4
Laravel 5.4 Nisha Patel
ย 
Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?John Blackmore
ย 
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 hot (20)

Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)Introduction to Laravel Framework (5.2)
Introduction to Laravel Framework (5.2)
ย 
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)
ย 
Knowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkKnowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP framework
ย 
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
ย 
A introduction to Laravel framework
A introduction to Laravel frameworkA introduction to Laravel framework
A introduction to Laravel framework
ย 
Intro to Laravel
Intro to LaravelIntro to Laravel
Intro to Laravel
ย 
All Aboard for Laravel 5.1
All Aboard for Laravel 5.1All Aboard for Laravel 5.1
All Aboard for Laravel 5.1
ย 
Laravel 5 New Features
Laravel 5 New FeaturesLaravel 5 New Features
Laravel 5 New Features
ย 
10 Laravel packages everyone should know
10 Laravel packages everyone should know10 Laravel packages everyone should know
10 Laravel packages everyone should know
ย 
Laravel.IO A Use-Case Architecture
Laravel.IO A Use-Case ArchitectureLaravel.IO A Use-Case Architecture
Laravel.IO A Use-Case Architecture
ย 
Laravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routingLaravel 5 Annotations: RESTful API routing
Laravel 5 Annotations: RESTful API routing
ย 
Laravel 5
Laravel 5Laravel 5
Laravel 5
ย 
Presentation laravel 5 4
Presentation laravel 5 4Presentation laravel 5 4
Presentation laravel 5 4
ย 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel framework
ย 
Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.Laravel - Website Development in Php Framework.
Laravel - Website Development in Php Framework.
ย 
MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5 MidwestPHP 2016 - Adventures in Laravel 5
MidwestPHP 2016 - Adventures in Laravel 5
ย 
Laravel 5.4
Laravel 5.4 Laravel 5.4
Laravel 5.4
ย 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
ย 
Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?Digpen 7: Why choose Laravel?
Digpen 7: Why choose Laravel?
ย 
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
ย 

Viewers also liked

An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)daylerees
ย 
Laravel Webcon 2015
Laravel Webcon 2015Laravel Webcon 2015
Laravel Webcon 2015Tim Bracken
ย 
CQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility SegregationCQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility SegregationBrian Ritchie
ย 
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPTPiyush Aggarwal
ย 
Intro to Laravel PHP Framework
Intro to Laravel PHP FrameworkIntro to Laravel PHP Framework
Intro to Laravel PHP FrameworkBill Condo
ย 
Implementing DDD Concepts in PHP
Implementing DDD Concepts in PHPImplementing DDD Concepts in PHP
Implementing DDD Concepts in PHPSteve Rhoades
ย 
Clean architecture with ddd layering in php
Clean architecture with ddd layering in phpClean architecture with ddd layering in php
Clean architecture with ddd layering in phpLeonardo Proietti
ย 
Domain Driven Design using Laravel
Domain Driven Design using LaravelDomain Driven Design using Laravel
Domain Driven Design using Laravelwajrcs
ย 

Viewers also liked (8)

An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
ย 
Laravel Webcon 2015
Laravel Webcon 2015Laravel Webcon 2015
Laravel Webcon 2015
ย 
CQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility SegregationCQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility Segregation
ย 
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
ย 
Intro to Laravel PHP Framework
Intro to Laravel PHP FrameworkIntro to Laravel PHP Framework
Intro to Laravel PHP Framework
ย 
Implementing DDD Concepts in PHP
Implementing DDD Concepts in PHPImplementing DDD Concepts in PHP
Implementing DDD Concepts in PHP
ย 
Clean architecture with ddd layering in php
Clean architecture with ddd layering in phpClean architecture with ddd layering in php
Clean architecture with ddd layering in php
ย 
Domain Driven Design using Laravel
Domain Driven Design using LaravelDomain Driven Design using Laravel
Domain Driven Design using Laravel
ย 

Similar to What's New In Laravel 5

้–ข่ฅฟPHPๅ‹‰ๅผทไผš php5.4ใคใพใฟใใ„
้–ข่ฅฟPHPๅ‹‰ๅผทไผš php5.4ใคใพใฟใใ„้–ข่ฅฟPHPๅ‹‰ๅผทไผš php5.4ใคใพใฟใใ„
้–ข่ฅฟPHPๅ‹‰ๅผทไผš php5.4ใคใพใฟใใ„Hisateru Tanaka
ย 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207patter
ย 
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)James Titcumb
ย 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
ย 
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)arcware
ย 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)James Titcumb
ย 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
ย 
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)James Titcumb
ย 
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
ย 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...King Foo
ย 
Phpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friendsPhpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friendsMichael Peacock
ย 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)James Titcumb
ย 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js frameworkBen Lin
ย 
Complex Sites with Silex
Complex Sites with SilexComplex Sites with Silex
Complex Sites with SilexChris Tankersley
ย 
PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)xSawyer
ย 
Laravel 5.5 dev
Laravel 5.5 devLaravel 5.5 dev
Laravel 5.5 devRocketRoute
ย 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
ย 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenchesLukas Smith
ย 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealedFabien Potencier
ย 
Laravel5 Introduction and essentials
Laravel5 Introduction and essentialsLaravel5 Introduction and essentials
Laravel5 Introduction and essentialsPramod Kadam
ย 

Similar to What's New In Laravel 5 (20)

้–ข่ฅฟPHPๅ‹‰ๅผทไผš php5.4ใคใพใฟใใ„
้–ข่ฅฟPHPๅ‹‰ๅผทไผš php5.4ใคใพใฟใใ„้–ข่ฅฟPHPๅ‹‰ๅผทไผš php5.4ใคใพใฟใใ„
้–ข่ฅฟPHPๅ‹‰ๅผทไผš php5.4ใคใพใฟใใ„
ย 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
ย 
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
ย 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
ย 
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
ย 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
ย 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
ย 
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)
ย 
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...
ย 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
ย 
Phpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friendsPhpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friends
ย 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
ย 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
ย 
Complex Sites with Silex
Complex Sites with SilexComplex Sites with Silex
Complex Sites with Silex
ย 
PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)
ย 
Laravel 5.5 dev
Laravel 5.5 devLaravel 5.5 dev
Laravel 5.5 dev
ย 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
ย 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
ย 
Symfony2 revealed
Symfony2 revealedSymfony2 revealed
Symfony2 revealed
ย 
Laravel5 Introduction and essentials
Laravel5 Introduction and essentialsLaravel5 Introduction and essentials
Laravel5 Introduction and essentials
ย 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
ย 
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...Steffen Staab
ย 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
ย 
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 ...harshavardhanraghave
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
ย 
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.pdfkalichargn70th171
ย 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
ย 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
ย 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
ย 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
ย 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
ย 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
ย 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
ย 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
ย 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
ย 
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธDelhi Call girls
ย 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
ย 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
ย 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
ย 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
ย 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
ย 
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
ย 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
ย 
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 ...
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
ย 
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
ย 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
ย 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ย 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
ย 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
ย 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
ย 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
ย 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
ย 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
ย 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
ย 
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
ย 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
ย 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
ย 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
ย 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
ย 

What's New In Laravel 5

  • 2. @minusdarren Introduction Darren Craig CTO - @minus40co โ˜… Built my ๏ฌrst website in 1998 โ˜… Hosted on FortuneCity โ˜… Developing in PHP for over 10 years โ˜… Superstar DJ โ€ฆ in Microsoft Word (ish)
  • 3. Caveats โ˜… Code is an example only - not best practiceโ€ฆ โ˜… โ€ฆor consistent! โ˜… Mix of basic and advanced ideas โ˜… Please ask questions! โ˜… More than one way to skin a cat
  • 5. What is Laravel? โ˜… PHP Framework โ˜… V1 was released in 2011 โ˜… Taylor Otwell (@taylorotwell) โ˜… V5 released in February 2015 โ˜… Laracon - Annual conferences in EU & US
  • 6. Why are you talking about it? โ˜… Using Laravel since v3 โ˜… Excellent Framework โ˜… Striving for better & more robust applications โ˜… Laravel helping lead the charge โ˜… PSR-4 โ˜… Contracts/Interfaces โ˜… Command Bus โ˜… SOLID principles โ˜… Community - DDD, Testing, Event Sourcing
  • 7. Under the hood โ˜… Uses Composer (http://getcomposer.org) โ˜… >= PHP 5.4 โ˜… Leverages lots of Symfony components โ˜… Artisan CLI โ˜… Eloquent ORM
  • 9. PHPSpec โ˜… Testing library โ˜… Uses โ€œDesign by Speci๏ฌcationโ€ class EmailAddressSpec { public function it_validates_the_email() { $this->shouldThrow('Exception')->during('__construct', ['InvalidEmail.com']) } public function it_normalizes_the_address() { $this->beConstructedWith('StrangeCASE@EmailAddress.com'); $this->getEmail()->shouldReturn('strangecase@emailaddress.com'); } } vendor/bin/phpspec describe EmailAddress vendor/bin/phpspec run
  • 10. PHPSpec class EmailAddress { private $email; public function __construct($email) { if( !filter_var($email, FILTER_VALIDATE_EMAIL) ) throw new Exception; $this->email = strtolower($email); } public function getEmail() { return $this->email; } }
  • 11. Elixir โ˜… Wrapper for GulpJS var elixir = require('laravel-elixir'); elixir(function(mix) { mix.less('app.less'); mix.styles([ "normalize.css", "main.css" ], 'public/build/css/everything.css'); mix.version(["css/all.css", "js/app.js"]); }); href=โ€œ/css/all-16d570a7.cssโ€œ><link rel="stylesheet" href="{{ elixir("css/all.css") }}">
  • 13. Directory Structure โ˜… Con๏ฌg, DB, Views moved above the app directory โ˜… New directories within app/ โ˜… No โ€œmodelsโ€ directory โ˜… Leverages PSR-4 autoloadingโ€จ (http://www.php- ๏ฌg.org/psr/psr-4/) โ˜… App/ namespace = app/ folder php artisan app:name Acme
  • 15. Service Providers โ˜… Bootstrap/con๏ฌgure classes in your application โ˜… app/Providers โ˜… AppServiceProvider.php โ˜… BusServiceProvider.php โ˜… Con๏ฌgServiceProvider.php โ˜… EventServiceProvider.php โ˜… RouteServiceProvider.php โ˜… Referenced in con๏ฌg/app.php
  • 17. Routing โ˜… Routes moved to app/Http/routes.php โ˜… RESTful routes โ˜… No namespace necessary! Route::get(โ€˜/', 'WelcomeController@index'); $router->get(โ€˜/','WelcomeController@index'); Route::get(โ€ฆ); Route::post(โ€ฆ); Route::put(โ€ฆ); Route::patch(โ€ฆ); Route::delete(โ€ฆ);
  • 18. Routing โ˜… Route Variables Route::get('video/{video}', โ€˜VideoController@show'); Route::get('/video/{video}/comments/{comment}', 'VideoCommentsController@show'); // VideoController public function show($videoId) {} // VideoCommentsController public function show($videoId, $commendId) {} โ˜… Resource Routes Route::resource('video', 'VideoController'); @index @show @create @store @edit @update @delete
  • 19. Routing โ˜… Implicit Controllers Route::controller('videos', โ€˜VideoController'); class VideoController extends Controller { public function getIndex() {} // GET videos public function postProfile() {} // POST videos/profile public function anyAction() {} // ANY videos/action }
  • 20. RouteServiceProvider class RouteServiceProvider extends ServiceProvider { protected $namespace = โ€˜AppHttpControllers'; public function map(Router $router) { $router->group(['namespace' => $this->namespace], function($router) { require app_path('Http/routes.php'); }); } }
  • 21. Route Cache โ˜… Resolves and caches your routes ๏ฌle โ˜… Drastically speeds up applications with lots of routes php artisan route:cache
  • 23. Eloquent โ˜… Laravelโ€™s own Active Record implementation โ˜… Beautifully expressive syntax โ˜… Allows you to easily query and update your database โ˜… Has drivers for MySQL, SQLite, Postgres, SQL Server and Redis out of the box. โ˜… Lots of packages available for DB support
  • 24. Eloquent class User extends Model { public function comments() { return $this->hasMany('Comment'); } } $user = User::all(); $user = User::find(1); $user = User::where('name', =, $name)->first(); $user = User::where('age', <, 18)->get(); $user = User::with('comments')->get(); @foreach($user->comments as $comment) <li>{{ $comment->body }}</li> @endforeach
  • 25. Eloquent N+1 Problem // 1 query per comment $user = User::first(); @foreach($user->comments as $comment) <li>{{ $comment->body }}</li> @endforeach // 1 query total $user = User::with('comments')->first(); @foreach($user->comments as $comment) <li>{{ $comment->body }}</li> @endforeach
  • 27.
  • 28. IoC Container class UserController { public function getProfile() { $facebook = new Facebook(['appId' => 123, 'secret' => 'cohaaagan']); $user = $facebook->getUser(); } public function getFriends() { $facebook = new Facebook(['appId' => 123, 'secret' => 'cohaaagan']); $friends = $facebook->getFriends(); } }
  • 29. IoC Container class FooController { private $facebook; public function __construct() { $this->facebook = new Facebook(['appId' => 123, 'secret' => 'cohaaagan']); } } class BarController { private $facebook; public function __construct() { $this->facebook = new Facebook(['appId' => 123, 'secret' => 'cohaaagan']); } }
  • 30. IoC Container class AppServiceProvider extends ServiceProvider { public function register() { $this->app->bind('Facebook', function() { return new Facebook(['appId' => 123, 'secret' => 'cohaaagan']); }); } } โ˜… You can โ€˜tellโ€™ Laravel to provide a fully instantiated class instead of the requested class
  • 31. IoC Container class FooController { private $facebook; public function __construct() { $this->facebook = App::make('Facebook'); } } class FooController { private $facebook; public function __construct(Facebook $facebook) { $this->facebook = $facebook; } }
  • 33.
  • 34. Contracts โ˜… Also known as โ€œInterfacesโ€ โ˜… De๏ฌne the โ€˜Public APIโ€™ of your classes โ˜… Packaged as part of L5 โ˜… One for each of the the core Laravel services โ˜… Help you โ€˜decoupleโ€™ your code
  • 35. Contracts class UserController { public function __construct(SomeVendorMailGun $mail) { $this->mail = $mail; } public function registerUser() { $this->mail->send(...); } } โ˜… โ€œTightly coupledโ€ โ˜… What would happen if we changed from MailGun to Mandrill, or Gmail?
  • 36. Contracts namespace IlluminateContractsMail; interface Mailer { public function raw($text, $callback); public function send($view, array $data, $callback); public function failures(); } class UserController { public function __construct(IlluminateContractsMailMailer $mail) { $this->mail = $mail; } public function registerUser() { $this->mail->send(...); } }
  • 37. Contracts use IlluminateContractsMailMailer; class FacebookMailer implements Mailer { public function raw($text, $callback) {}; public function send($view, array $data, $callback) {}; public function failures() {}; } class AppServiceProvider extends ServiceProvider { public function register() { $this->app->bind('IlluminateContractsMailMailer', function() { return new FacebookMailer(); }); } }
  • 38. Contracts class UserController { public function __construct(IlluminateContractsMailMailer $mail) { $this->mail = $mail; } public function registerUser() { $this->mail->send(...); } } class AppServiceProvider extends ServiceProvider { public function register() { $this->app->bind('IlluminateContractsMailMailer', function() { return new TwitterMailer(); }); } }
  • 40. File Drivers โ˜… Improved version of the previous Filesystem class โ˜… Now powered by Flysystem (๏ฌ‚ysystem.thephpleague.com) โ˜… Allows for local & remote ๏ฌlesystems at the same time โ˜… Compatible with S3 & Rackspace โ˜… Support available for lots of others composer require league/flysystem-aws-s3-v2 ~1.0 composer require league/flysystem-rackspace ~1.0
  • 41. File Drivers - Con๏ฌguration // config/filesystems.php return [ 'default' => 'local', 'cloud' => 's3', 'disks' => [ 'local' => [ 'driver' => 'local', 'root' => storage_path().'/app', ], 's3' => [ 'driver' => 's3', 'key' => 'your-key', 'secret' => 'your-secret', 'region' => 'your-region', 'bucket' => 'your-bucket', ], 'rackspace' => [ 'driver' => 'rackspace', 'username' => 'your-username', 'key' => 'your-key', 'container' => 'your-container', 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/', 'region' => 'IAD', ], ], ];
  • 42. File Drivers - Usage $disk = Storage::disk('cloud'); $disk = Storage::disk('local'); $disk = Storage::disk('s3'); $exists = Storage::disk('s3')->exists('file.jpg'); $exists = $disk->exists('file.jpg'); $file = Storage::get('file.jpg'); Storage::put('file.jpg', $contents); Storage::prepend('file.log', 'Prepended Text'); Storage::append('file.log', 'Appended Text'); Storage::delete('file.jpg'); Storage::delete(['file1.jpg', 'file2.jpg']); Storage::copy('old/file1.jpg', 'new/file1.jpg');
  • 44. Method Injection โ˜… Uses the IoC container to resolve dependencies injected directly into a method. โ˜… Helps cut down on cluttered constructor methods class UserController { public function registerUser(Mailer $mail) { // do some registration stuff $mail->send(); } // Route::post('user/{id}/mail', 'UserController@mailUser'); public function mailUser($userId, Mailer $mail) { // do some registration stuff $mail->send(); } }
  • 46.
  • 47. Form Requests โ˜… Aim to standardise and simplify form validation โ˜… Validation in V3/4 was verbose: class UserController { public function register() { $rules = [ 'name' => 'required', 'email' => 'email|required' ]; $validator = Validator::make(Input::all(), $rules); if($validator->fails()) return redirect()->back()->withErrors(); // validation passed, do something... } }
  • 48. Form Requests โ˜… Form requests make things very cleanโ€ฆ class UserController { public function register(RegisterUserRequest $request) { // validation passed, do something... } } โ˜… Automatically validates โ˜… Automatically redirects back, with errors
  • 49. Form Requests โ˜… How to generate a request php artisan make:request RegisterUserRequest โ˜… Stored in app/Http/Requests class RegisterUserRequest extends Request { public function authorize() { return false; } public function rules() { return [ 'name' => 'required', 'email' => 'email|required' ]; } }
  • 50. Forms & HTML Helpers โ˜… Uses an expressive syntax to generate form ๏ฌelds & HTML entities โ˜… Removed from L5 as default โ˜… Available as a composer package composer require illuminate/html ~5.0
  • 52. Middleware โ˜… Route Decorators โ˜… Similar to ๏ฌlters (still available) โ˜… Executed before the logic of your application
  • 53. Middleware โ˜… Stored in app/Http/Middleware: โ˜… Authenticate โ˜… RedirectIfAuthenticated โ˜… VerifyCSRFToken โ˜… Easy to add your own php artisan make:middleware WhitelistedIP
  • 54. Middleware class WhitelistedIP { $ipWhitelist = [ '123.123.123.123' ]; public function handle($request, Closure $next) { if(!in_array($request->getClientIp(), $this->ipWhitelist)) { return redirect('/'); } return $next($request); } }
  • 55. โ€œAfterโ€ Middleware class DoSomethingAfter { public function handle($request, Closure $next) { $response = $next($request); // Perform action return $response; } }
  • 56. Middleware <?php namespace AppHttp; use IlluminateFoundationHttpKernel as HttpKernel; class Kernel extends HttpKernel { protected $middleware = [ 'IlluminateFoundationHttpMiddlewareCheckForMaintenanceMode', 'IlluminateCookieMiddlewareEncryptCookies', 'IlluminateCookieMiddlewareAddQueuedCookiesToResponse', 'IlluminateSessionMiddlewareStartSession', 'IlluminateViewMiddlewareShareErrorsFromSession', 'AppHttpMiddlewareVerifyCsrfToken', 'AppHttpMiddlewareWhitelistedIP' ]; protected $routeMiddleware = [ 'auth' => 'AppHttpMiddlewareAuthenticate', 'auth.basic' => 'IlluminateAuthMiddlewareAuthenticateWithBasicAuth', 'guest' => 'AppHttpMiddlewareRedirectIfAuthenticated', 'whitelisted' => 'AppHttpMiddlewareWhitelistedIP', ]; }
  • 57. Applying Route Middleware Route::group('admin/*', ['middleware' => 'whitelisted', function() { // protected }]); class UserController extends Controller { public function __construct() { $this->middleware('auth'); $this->middleware('log', ['only' => ['fooAction', 'barAction']]); $this->middleware('subscribed', ['except' => ['fooAction', 'barAction']]); } }
  • 59. Cron & Scheduling 15 6 2 1 * /home/melissa/backup.sh 17 6 2 1 * /home/carl/hourly-archive.sh 19 6 2 1 * /sites/my-site/artisan command:run 30 6 2 1 * /sites/my-site/artisan arnie:gettothechopper
  • 60. Laravelโ€™s Scheduler // app/Console/Kernel.php class Kernel extends ConsoleKernel { protected function schedule(Schedule $schedule) { $schedule->command('inspire')->hourly(); $schedule->command('foo')->everyFiveMinutes(); $schedule->command('foo')->everyThirtyMinutes(); $schedule->exec('composer self-update')->daily(); $schedule->command('foo')->weekdays(); $schedule->command('foo')->mondays(); $schedule->command(โ€˜foo')->sendOutputTo($filePath) ->emailOutputTo('foo@example.com'); } } * * * * * php /path/to/artisan schedule:run 1>> /dev/null 2>&1
  • 62.
  • 63. Command Bus โ˜… Separates the logic of you application into small, manageable actions โ˜… Creates reusable classes that can be used from different access points to your application โ˜… Helps keep your code DRY โ˜… Helps make your code testable
  • 64. Command Bus [ request ] [ command ] [ bus ] [ handler ]
  • 65. Command Bus [ request ] [ command ] [ bus ] [ handler ] A data transfer object, or message, which contains only the information required for carrying out a speci๏ฌc action Matches a command to the corresponding handler and executes it Responsible for carrying out the โ€˜taskโ€™ in response to the command.
  • 66.
  • 67. Command Bus [ request ] [ command ] [ bus ] [ handler ] POST /user/register RegisterUser RegisterUserHandler POST /user/updatePassword UpdateUserPassword UpdateUserPasswordHandler
  • 68. Creating a command class RegisterUser extends Command { public $name; public $email; public $password; public function __construct($name, $email, $password) { $this->name = $name; $this->email = $email; $this->password = $password; } } php artisan make:command RegisterUser app/Commands/RegisterUser.php
  • 69. Dispatching the command class UserController extends Controller { use DispatchesCommands; public function postRegister(RegisterUserRequest $request) { $this->dispatch(new RegisterUser( $request->get('name'), $request->get('email'), $request->get('password') )); // OR $this->dispatchFrom(RegisterUser::class, $request); } }
  • 70. The Command Handler class RegisterUserHandler { public function handle(RegisterUser $command) { $user = User::create([ 'name' => $command->name, 'email' => $command->email, 'password' => Hash::make('password') ]); } } php artisan handler:command RegisterUserHandler
  • 71. Creating a command class UpdateUserPassword extends Command { public $userId; public $password; public function __construct($userId, $password) { $this->userId = $userId; $this->password = $password; } } php artisan make:command UpdateUserPassword app/Commands/UpdateUserPassword.php
  • 72. The Command Handler class UpdateUserPasswordHandler { public function handle(RegisterUser $command) { $user = User::find($command->userId); $user->updatePassword( Hash::make($command->password) ); } } php artisan handler:command UpdateUserPasswordHandler
  • 73. Queued Commands php artisan make:command ExampleQueuedCommand --queued use IlluminateQueueSerializesModels; use IlluminateQueueInteractsWithQueue; use IlluminateContractsQueueShouldBeQueued; class ExampleQueuedCommand extends Command implements ShouldBeQueued { use InteractsWithQueue, SerializesModels; public function __construct() { // } }
  • 75. Events โ˜… Also known as the Publish-Subscribe pattern โ˜… Used to model concerns of the application youโ€™re building โ˜… Work in a similar way to Commands
  • 76. Generating An Event php artisan make:event UserWasRegistered use AppEventsEvent; use IlluminateQueueSerializesModels; class UserWasRegistered extends Event { use SerializesModels; public $user; public function __construct(User $user) { $this->user = $user; } } app/EventsUserWasRegistered.php
  • 77. The Event Handler class SendRegistrationConfirmation { public function __construct() { // } public function handle(UserWasRegistered $event) { // send mail } } php artisan handler:event SendRegistrationConfirmation --event=UserWasRegistered
  • 78. Registering Events class EventServiceProvider extends ServiceProvider { protected $listen = [ UserWasRegistered::class => [ SendRegistrationConfirmation::class, GenerateHolidayEntitlement::class, SetServerPermissions::class, NotifyCurrentEmployees::class ] ]; } app/Providers/EventServiceProvider.php
  • 79. Firing Events class RegisterUserHandler { public function handle(RegisterUser $command) { // register the user $user Event::fire(new UserWasRegistered($user)); } } app/Handlers/Commands/RegisterUserHandler.php
  • 81. Optional Packages โ˜… Socialite โ˜… Provides a consistent interface for authentication using social networks โ˜… Returns a consistent user object & API to get name, email, avatar, etc composer require "laravel/socialite": "~2.0"
  • 82. Optional Packages โ˜… Cashier โ˜… Provides a ๏ฌ‚uent interface for Stripe โ˜… Handles creating/modifying subscriptions, recurring charges, free trials, failed payments and invoices composer require "laravel/cashier": "~3.0"
  • 84. Learning Laravel โ˜… Laravel Docs (http://laravel.com/docs) โ˜… Laracasts (http://laracasts.com) โ˜… Twitter @laravelphp โ˜… IRC โ˜… #Laravel โ˜… #Dev-Discussions