Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Laravel Ecosystem

The Laravel Ecosystem


Dries Vints

August 25, 2015

More Decks by Dries Vints

Other Decks in Programming


  1. The Laravel Ecosystem

  2. Hi! I'm Dries

  3. I lead the BeatSwitch development team Festival Management Software beatswitch.com

  4. I maintain Laravel.io The Laravel Community Portal

  5. I organize PHP Antwerp 2 meetups so far 120 developers

  6. What will I not be talking about?

  7. Not a sales talk

  8. No how-to's Check out laracasts.com for some great tutorials

  9. The Laravel Ecosystem

  10. Developer happiness, from download to deploy

  11. We spend so much time crafting amazing applications But often

    fail to find time to improve our workflow
  12. Web development today isn't web development from 10 years ago

  13. ~2002 HTML, CSS, JavaScript, PHP, SQL

  14. 2015 HTML, CSS, JavaScript, PHP, SQL, Virtual Machines, Vagrant, NoSQL,

    SSH, Git, PSR's, Grunt, Gulp, Node.js, Bower, Homebrew, OAuth, Frameworks, ORM, JSON, jQuery, Bootstrap, Angular, Composer, Unit Testing, Caching, Queues, TDD, DDD, BDD, Templating, Middleware1 1 http://alexking.org/blog/2015/05/14/web-development-now-complicated
  15. We’ve Made Web Development Complicated 1 Alex King

  16. Full Stack is an abused term

  17. What is a Full Stack developer?2 1. Server, Network, and

    Hosting Environment 2. Data Modeling 3. Business Logic 4. API layer / Action Layer / MVC 5. User Interface 6. User Experience 7. Understanding what the customer and the business need 2 http://www.laurencegellert.com/2012/08/what-is-a-full-stack-developer/
  18. There's so much to learn

  19. Does anyone recognize themselves in this?

  20. Not everyone has time to learn All The Things™

  21. I can't learn everything

  22. What if the tools we use didn't require us to

    learn everything?
  23. Laravel offers an ecosystem which enables developers to focus on

    what's important
  24. The Framework

  25. It brings code back to the essence // Zend $route

    = Literal::factory([ 'route' => '/foo', 'defaults' => [ 'controller' => 'foo', 'action' => 'index', ], ]); $router->addRoute('foo', $route); // Laravel Route::get('foo', 'FooController@index');
  26. It hides complexity // Doctrine $criteria = new \Doctrine\Common\Collections\Criteria(); $criteria->where($criteria->expr()->gt('votes',

    100)) ->andWhere($criteria->expr()->eq('active', 1)); $posts = $em->getRepository('Post')->matching($criteria); // Eloquent $posts = Post::where('votes', '>', 100) ->where('active', 1) ->get(); // Eloquent (using query scopes) $posts = Post::popular()->active()->get();
  27. It's clean and readable // Symfony $client = static::createClient(); $client->request('GET',

    '/post/hello-world'); $this->assertContains( 'Hello World', $client->getResponse()->getContent() ); // Laravel (Thanks Jeffrey!) $this->visit('/post/hello-world') ->see('Hello World');
  28. It simplifies complex topics // Cron jobs in Laravel $schedule->command('cache:clear')

    ->hourly() ->sendOutputTo($logFile) ->emailOutputTo('hello@laravel.io');
  29. Laravel has become an essential tool in the workflow of

    many developers
  30. You can even use the components separately github.com/mattstauffer/IlluminateNonLaravel

  31. Laravel enables Rapid Application Development (RAD)

  32. It allows ideas to come to life in a small

    amount of time
  33. A lot of people think that RAD is a problem

  34. But it really just depends on the situation

  35. Laravel only limits you to do something when you choose

    to see it like that
  36. Lumen

  37. Lumen 4 Micro-framework for Micro-services 4 Sacrifices configurability for speed

    4 Easy upgrade to a full Laravel application
  38. The Extensions

  39. Socialite

  40. Social authentication has never been easier public function redirectToProvider() {

    return Socialite::driver('github')->redirect(); } public function handleProviderCallback() { $user = Socialite::driver('github')->user(); // register user }
  41. Need more providers? Flickr, DigitalOcean, Meetup, Paypal, Slack, Trello, Mailchimp,

    Youtube, Uber, Instagram, Foursquare, Dropbox, Dribbble, Jira, Disqus, SoundCloud, Spotify, Reddit, ... ...and many more socialiteproviders.github.io
  42. Cashier

  43. Billing without the hassle // Create a subscription $user->subscription('monthly')->create($creditCardToken); //

    Change a user's plan $user->subscription('premium')->swap(); // Cancel a subscription $user->subscription()->cancel();
  44. Envoy

  45. A simple deployment solution @servers(['web' => '']) @task('deploy', ['on' =>

    'web']) cd site git pull origin {{ $branch }} php artisan migrate @endtask
  46. A simple deployment solution 4 Handles SSH tasks 4 Deploy

    on multiple servers at once 4 Can be configured like Envoyer: serversforhackers.com/video/deploying-with- envoy-cast 4 Also check out Rocketeer: rocketeer.autopergamene.eu
  47. We couldn't forget about those front-enders now, could we?

  48. Elixir

  49. Gulp Simplified3 elixir(function(mix) { mix.sass('app.scss') .scripts(['jquery.js', 'app.js']) .phpUnit() .phpSpec(); });

    Compilation, concatenation, minification, auto-prefixing, ... 3 how's that even possible?
  50. Support for 4 Source Maps 4 CoffeeScript 4 Browserify 4

    Babel 4 ...
  51. Versioning / Cache Busting elixir(function(mix) { mix.version('css/app.css'); }); <link rel="stylesheet"

    href="{{ elixir('css/app.css') }}"> css/app-22c7eedf.css
  52. Laravel Spark ⚡ Coming Soon

  53. Named after a dear community member

  54. Just messing with you !

  55. Spark provides a base for SaaS apps 4 Billing 4

    Team management 4 Invitations 4 Registration 4 2-factor auth 4 ...
  56. Recap 4 Simple and elegant code 4 Hides complexity 4

    Powerful extensions 4 RAD
  57. But what about our development environment?

  58. “It works on my computer” 1 Every developer ever

  59. Virtualization to the rescue!

  60. Such devops, very learn, much difficult

  61. Luckily there's help 4 PuPHPet 4 Phansible (By @erikaheidi) 4

    Protobox 4 Vaprobash (By @fideloper)
  62. Homestead

  63. Comes with everything you need 4 Ubuntu 14.04 4 PHP

    5.6 & HHVM 4 Nginx 4 MySQL & Postgres 4 Node 4 Memcached 4 ...
  64. Use it with VirtualBox or VMware

  65. Easy configuration Configure synced folders folders: - map: ~/Code to:

    /home/vagrant/Code Configure Nginx sites sites: - map: homestead.app to: /home/vagrant/Code/Laravel/public
  66. Easily configure things like Blackfire.io Configure blackfire: - id: your-server-id

    token: your-server-token client-id: your-client-id client-token: your-client-token And run homestead provision
  67. Install per-project Thanks to Joe P Ferguson! (@joepferguson) composer require

    laravel/homestead --dev php vendor/bin/homestead make vagrant up
  68. Homestead offers many benefits 4 Get devs up and running

    quickly 4 Quickly get an new app set up 4 Get your devs on the same environment 4 Same environment as your Forge servers
  69. To the clouds!

  70. Configuring servers isn't the easiest task

  71. Luckily, there's help serversforhackers.com digitalocean.com/community/tutorials

  72. Forge

  73. Forge is awesome 4 Automates the process to setup a

    server 4 You don't need to learn how to set up one 4 Saves you the effort of setting everything up 4 Globally, saves you ridiculous amounts of time
  74. Comes with tons of benefits 4 Create load balancers 4

    Easily setup tools like New Relic, Papertrail, Blackfire.io 4 Easily setup cronjobs 4 Auto deploy your code 4 Same environment as Homestead
  75. You can set up 4 A Load Balancer 4 A

    couple of servers 4 SSL Certificate 4 New Relic, Papertrail & Blackfire.io 4 Cronjobs, Queue workers In less than 30 minutes
  76. But how do we easily get our code deployed?

  77. Envoyer

  78. Envoyer ≠ Envoy

  79. Envoyer offers 4 Zero downtime deployments 4 Seamless rollbacks 4

    Cron jobs monitoring with heartbeats 4 Deployment health status
  80. Envoyer is optimized for Laravel But can easily be used

    for any project
  81. The Missing Links

  82. Continuous Delivery

  83. tests.sh #!/bin/bash PHPUNIT_RESULT=`vendor/bin/phpunit` PHPSPEC_RESULT=`vendor/bin/phpspec run` if [[ ${PHPUNIT_RESULT} =~ FAILURES

    ]] || [[ ${PHPSPEC_RESULT} =~ failed ]] then echo "Test have failed!"; echo ${PHPUNIT_RESULT}; echo ${PHPSPEC_RESULT}; # Notify Slack? else # Trigger deployment curl -s 'https://envoyer.io/deploy/this-is-a-dummy-url'; echo 'Deployment triggered!' fi
  84. How to set it up? 4 Create a new Forge

    instance 4 Add the code below as deploy script 4 Enable quick deploy cd /home/forge/default git pull origin master composer install --dev ./tests.sh
  85. Quality Assurance

  86. This ecosystem saves you money 4 Laravel: Free 4 Homestead:

    Free 4 Forge: $10 per month (unlimited servers) 4 Envoyer: $10 per month (10 projects) 4 DigitalOcean or Linode: $10 per month Total: ~$30 per month / ~$360 per year
  87. Use them separately 4 Laravel to build something amazing 4

    Elixir to optimize your frontend workflow 4 Homestead to develop your PHP apps 4 Forge to setup your servers 4 Envoyer to deploy your apps
  88. Together they make an amazing Ecosystem Laravel, Lumen, Spark, Socialite,

    Cashier, Elixir, Homestead, Forge, Envoyer
  89. But what's an ecosystem without an amazing community?

  90. Some prominent community members 4 Taylor Otwell 4 Jeffrey Way

    4 Eric Barnes 4 Graham Campbell 4 Matt Stauffer 4 Dayle Rees
  91. But what about the others?

  92. No, not those others!

  93. I mean these people! Pic by Matt Stauffer

  94. Maxime Fabre @anahkiasen 4 Developer at madewithlove 4 Creator of

    Rocketeer rocketeer.autopergamene.eu
  95. Mior Muhammad Zaki @crynobone 4 Founder of the Orchestra Platform

  96. Fortrabbit - PaaS Hosting Meet Frank Lämmer, Oliver Stark &

    Ulrich Katz
  97. Dan Syme @dansyme 4 Owner of Cartalyst cartalyst.com 4 Blogger

    4 Invests a lot in the Laravel Community
  98. Barry Van Den Heuvel @barryvdh 4 Founder of Fruitcake Studio

    fruitcakestudio.nl 4 Creator of Laravel Debugbar, Laravel IDE Helper, and many other packages
  99. Joe Ferguson @JoePFerguson 4 Conference Speaker 4 Blogger

  100. Abigail Otwell @abigailotwell 4 Laravel's biggest supporter 4 Founder of

    LaraBelle larabelleclothing.com
  101. Jeroen Gerits @JeroenGerits 4 Freelance Web Developer 4 Conference Organiser

  102. Why do I spend so many time talking about these

  103. Because it matters

  104. How can the community help you?

  105. Talk to fellow Artisans when you're stuck #laravel on IRC

    Larachat.co stackoverflow.com laracasts.com/discuss laravel.io
  106. Send in a pull request

  107. Create an open-source project

  108. Dive into the core github.com/laravel/framework

  109. ! Channelling my inner Coderabbi ! Start a user group

  110. Start talking!

  111. Open-Source isn't only about opening up your code to others

    It's also about opening up yourself to others
  112. Learn from each other Talk to each other Build amazing

    things together
  113. Don't forget the rest of the PHP community

  114. Do what you love and only what you love, regardless

    of how much someone is willing to pay you to do otherwise 1 Lee Tengum @ThatLeeGuy
  115. The best ecosystem is still a helpful, diverse and respectful

  116. Thank you! !

  117. joind.in/15014