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

3,241 views

Published on

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

Published in: Software
1 Comment
11 Likes
Statistics
Notes
No Downloads
Views
Total views
3,241
On SlideShare
0
From Embeds
0
Number of Embeds
128
Actions
Shares
0
Downloads
86
Comments
1
Likes
11
Embeds 0
No embeds

No notes for slide

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

  1. 1. ( and history of ) An Introduction to Laravel PHP
  2. 2. Who the fudge is this guy? • Dayle Rees. • 30 in December. *cry* • Lives in Cardiff with GF Emma.
  3. 3. Welsh! ( Sounds English )
  4. 4. The Red Panda Guy Also Big Panda / PHPanda / 1000s of others. ( Now, Le Panda Rouge? )
  5. 5. • Head of Development • Startup (Seed round A) • Index Ventures (Facebook!) • Sharing Economy • http://www.justpark.com • (Previously ParkatmyHouse)
  6. 6. Laravel Team Member • One of the first users. • Team of high profile PHP developers. • Laravel 3 Bundles • Laravel 4 Bundles
  7. 7. Accidental Author Over 7000 readers. #1 gross earnings. http://leanpub.com/codebright
  8. 8. Laracons! Spoke Washington DC (Laracon US 2013) New York (Laracon US 2014) Attended Amsterdam (Laracon EU 2013) Amsterdam (Laracon EU 2014)
  9. 9. Colour Schemes “Engineer” http://github.com/daylerees/colour-schemes 100 or so themes for a numbers of editors and libraries.
  10. 10. Merci!
  11. 11. What’s this talk all about? Open source, history and growth. (Story time.) Laravel. (Cool stuff!)
  12. 12. Let’s go back in time to 2011! (Imagine wibbly-wobbly effect.)
  13. 13. Working in Aberystwyth •Using CodeIgniter. •Simple projects. •No side projects. •Not “known” for anything.
  14. 14. Contributed to CodeIgniter Started out with graphic contributions. Accepted by Phil Sturgeon. (Thanks Phil!) Rejected by EllisLab. Started to outgrow the framework.
  15. 15. Time for a new framework! VS
  16. 16. Laravel 2.something • Simple website. • Great documentation. • Clean and simple code. • No users. • Mystery author.
  17. 17. Community time! • Became active in IRC. • Then: 3 people. Now: ~600. • Started writing tutorials. • Tutorials got attention. • Released Code Happy. • CodeIgniter users shifting across.
  18. 18. 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.
  19. 19. Friendship Taylor Otwell (Grand Master Artisan)
  20. 20. Laravel 3 had it’s flaws. TESTING :( EXTENSIBILITY :’(
  21. 21. 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!)
  22. 22. The Promise • No preaching! • No moaning about other frameworks. • Just cool features! • Intro to IOC / DI.
  23. 23. 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.
  24. 24. Automatic type-hinted dependency resolution and injection inversion of control container.
  25. 25. Magic Code Box
  26. 26. Basic Usage
  27. 27. The same something!
  28. 28. Automatic Class Resolution ( From the magic box! )
  29. 29. Type-hinted Dependency Resolution
  30. 30. Tricking the magic box.
  31. 31. Let’s do something cool.
  32. 32. Implementations ( Shameless colour schemes promo.)
  33. 33. Bind the interface. ( Still have no shame, I mean, just look at the beard.)
  34. 34. Use our new service. Imagine username here.
  35. 35. Interchangeable!
  36. 36. Components / Services
  37. 37. Facades! Resolve the service from the container (magic box) by known key. Forward the method call to the real service instance with parameters.
  38. 38. Replacing components.
  39. 39. Why bind?
  40. 40. 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! )
  41. 41. Routes
  42. 42. Resource Controller
  43. 43. Named Routes
  44. 44. Route Filters ( Defaults: csrf auth auth.basic guest )
  45. 45. Route Groups
  46. 46. Database time! ( Drivers: MySQL, PostgresSQL, SQLite, SQL Server )
  47. 47. Eloquent Models
  48. 48. Eloquent Models
  49. 49. Relationships
  50. 50. Relationships
  51. 51. Eager Loading
  52. 52. Queues Drivers: Beanstalkd, IronMQ, Amazon SQS, Redis.
  53. 53. Queues
  54. 54. Authentication
  55. 55. Cache ( Drivers: Database, File, APC, Memcached, XCache, WinCache, Redis, Array, Null )
  56. 56. Cache
  57. 57. Events
  58. 58. Model Events
  59. 59. Artisan
  60. 60. Artisan Commands
  61. 61. Sending Mail ( Drivers: SMTP, Mailgun, Mandrill. )
  62. 62. Validation ( Because users are wrong… always. )
  63. 63. 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.
  64. 64. Laravel Forge • PHP Hosting for Artisans. • Push to deploy. • Choose your own cloud. • Latest web stack. • HHVM ready. • Recipes. (stored scripts)
  65. 65. 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
  66. 66. 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!

×