an introduction to the laravel framework (afup forum php 2014)

67
An Introduction to Laravel PHP ( and history of )

Upload: daylerees

Post on 01-Dec-2014

731 views

Category:

Software


4 download

DESCRIPTION

An introduction to, and history of, the Laravel framework for PHP.

TRANSCRIPT

Page 1: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

An Introduction to Laravel PHP( and history of )

Page 2: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Who the fudge is this guy?

• Dayle Rees.

• 30 in December. *cry*

• Lives in Cardiff with GF Emma.

Page 3: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Welsh!( Sounds English )

Page 4: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

The Red Panda GuyAlso Big Panda / PHPanda / 1000s of others.

( Now, Le Panda Rouge? )

Page 5: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

• Head of Development

• Startup (Seed round A)

• Index Ventures (Facebook!)

• Sharing Economy

• http://www.justpark.com

• (Previously ParkatmyHouse)

Page 6: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Laravel Team Member• One of the first users.

• Team of high profile PHP developers.

• Laravel 3 Bundles

• Laravel 4 Bundles

Page 7: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Author

Over 7000 readers. #1 gross earnings. http://leanpub.com/codebright

Accidental

Page 8: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Spoke

Washington DC (Laracon US 2013) New York (Laracon US 2014)

Attended

Amsterdam (Laracon EU 2013) Amsterdam (Laracon EU 2014)

Laracons!

Page 9: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Colour Schemes “Engineer”

http://github.com/daylerees/colour-schemes

100 or so themes for a numbers of editors and libraries.

Page 10: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
Page 11: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Merci!

Page 12: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

What’s this talk all about?

Open source, history and growth. (Story time.)

Laravel. (Cool stuff!)

Page 13: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Let’s go back in time to 2011!(Imagine wibbly-wobbly effect.)

Page 14: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Working in Aberystwyth

•Using CodeIgniter.

•Simple projects.

•No side projects.

•Not “known” for anything.

Page 15: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Contributed to CodeIgniter

Started out with graphic contributions. Accepted by Phil Sturgeon. (Thanks Phil!)

Rejected by EllisLab. Started to outgrow the framework.

Page 16: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Time for a new framework!

VS

Page 17: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Laravel 2.something

• Simple website. • Great documentation. • Clean and simple code. • No users. • Mystery author.

Page 18: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Community time!• Became active in IRC. • Then: 3 people. Now: ~600. • Started writing tutorials. • Tutorials got attention. • Released Code Happy. • CodeIgniter users shifting across.

Page 19: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Involvement (L3)• Started submitting fixes and features to the pre-

release Laravel 3.

• Helped build/design the website for Laravel 3 (and later 4).

• Did lots of visual work for the framework including splash screens.

• Built popular bundles for Laravel 3.

• Help build a welcoming and helpful community.

Page 20: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Friendship

Taylor Otwell(Grand Master Artisan)

Page 21: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Laravel 3 had it’s flaws.

TESTING :(

EXTENSIBILITY :’(

Page 22: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Time for Laravel 4!• Taylor started work on Laravel 4.

• One of first users when it was built on Silex.

• Feedback loop.

• Exciting new architecture.

• Stable release cycle.

• Powered by Composer (Thanks Jordi!)

• Component-based framework.

• Uses plenty of open source! (Some Symfony, thanks Fabpot!)

Page 23: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

The Promise• No preaching!

• No moaning about other frameworks.

• Just cool features!

• Intro to IOC / DI.

Page 24: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Laravel• Coding should be enjoyable. • Code can be art. • Clean and simple syntax. • Your framework should grow with you. • A complete platform, end to end. • Components that solve real problems.

• Embrace open source, and make use of it where possible.

• Give back to open source community where possible.

• A community of friendly Artisans.

Page 25: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Automatic type-hinted dependency resolution and injection inversion of control container.

Page 26: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Magic Code Box

Page 27: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Basic Usage

Page 28: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

The same something!

Page 29: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Automatic Class Resolution( From the magic box! )

Page 30: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Type-hinted Dependency Resolution

Page 31: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Tricking the magic box.

Page 32: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Let’s do something cool.

Page 33: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Implementations

( Shameless colour schemes promo.)

Page 34: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Bind the interface.

( Still have no shame, I mean, just look at the beard.)

Page 35: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Use our new service.

Imagine username here.

Page 36: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Interchangeable!

Page 37: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Components / Services

Page 38: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Facades!

Resolve the service from the container (magic box) by known key.

Forward the method call to the real service instance with parameters.

Page 39: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Replacing components.

Page 40: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Why bind?

Page 41: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

The Magic Box Revisited• Not just a data store!

• A number of binding methods.

• Automated class resolution.

• Automatic dependency injection.

• Interface binding.

• Service replacement / mocking.

• Extensible framework.

• Facades without the testing problems.

• The heart of the framework!

• illuminate/container

( Not so magic anymore, hopefully! )

Page 42: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Routes

Page 43: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Resource Controller

Page 44: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Named Routes

Page 45: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Route Filters

( Defaults: csrf auth auth.basic guest )

Page 46: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Route Groups

Page 47: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Database time!( Drivers: MySQL, PostgresSQL, SQLite, SQL Server )

Page 48: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Eloquent Models

Page 49: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Eloquent Models

Page 50: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Relationships

Page 51: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Relationships

Page 52: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Eager Loading

Page 53: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

QueuesDrivers: Beanstalkd, IronMQ, Amazon SQS, Redis.

Page 54: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Queues

Page 55: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Authentication

Page 56: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Cache( Drivers: Database, File, APC, Memcached, XCache, WinCache, Redis, Array, Null )

Page 57: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Cache

Page 58: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Events

Page 59: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Model Events

Page 60: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Artisan

Page 61: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Artisan Commands

Page 62: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Sending Mail( Drivers: SMTP, Mailgun, Mandrill. )

Page 63: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Validation

( Because users are wrong… always. )

Page 64: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

More!• Redis Client • Blade Templating • Stripe subscription-based billing. • Log system. • Custom exception handling. • Informative debugging. • Form helpers. • Localisation. • Workbench. • Paginator.

• Session Wrapper. • Remote SSH component. • Test helpers. • Database seeding. • Route model binding. • Response casting. • Environment-based config loader.

Loads more! Hands are tired from typing.

Page 65: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Laravel Forge

• PHP Hosting for Artisans. • Push to deploy. • Choose your own cloud. • Latest web stack. • HHVM ready. • Recipes. (stored scripts)

Page 66: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

Homestead• Ubuntu 14.04 • PHP 5.6 • HHVM • Nginx • MySQL • Postgres • Node (With Bower,

Grunt, and Gulp)

• Redis • Memcached • Beanstalkd • Laravel Envoy • Fabric + HipChat

Extension

Page 67: An Introduction to the Laravel Framework (AFUP Forum PHP 2014)

What are you waiting for?( Thanks for listening! Sorry if I’ve got 20 minutes left! )

composer create-project laravel/laravel

• Visit #laravel on Freenode. • Read Code Bright (come give me your email for a free copy) • Watch some Laracasts! (Sup Jeff!) • Visit Laravel.io and listen to the podcast! • Follow some Laravel guys on twitter. ( @daylerees @taylorotwell @jeffrey_way ) • Come say bonjour to me!