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

The Laravel Ecosystem

The Laravel Ecosystem

Dries Vints

August 25, 2015
Tweet

More Decks by Dries Vints

Other Decks in Programming

Transcript

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

    fail to find time to improve our workflow
  2. 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
  3. 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/
  4. 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');
  5. 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();
  6. 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');
  7. Social authentication has never been easier public function redirectToProvider() {

    return Socialite::driver('github')->redirect(); } public function handleProviderCallback() { $user = Socialite::driver('github')->user(); // register user }
  8. 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
  9. 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();
  10. A simple deployment solution @servers(['web' => '192.168.1.1']) @task('deploy', ['on' =>

    'web']) cd site git pull origin {{ $branch }} php artisan migrate @endtask
  11. 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
  12. 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?
  13. Spark provides a base for SaaS apps 4 Billing 4

    Team management 4 Invitations 4 Registration 4 2-factor auth 4 ...
  14. Comes with everything you need 4 Ubuntu 14.04 4 PHP

    5.6 & HHVM 4 Nginx 4 MySQL & Postgres 4 Node 4 Memcached 4 ...
  15. 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
  16. 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
  17. Install per-project Thanks to Joe P Ferguson! (@joepferguson) composer require

    laravel/homestead --dev php vendor/bin/homestead make vagrant up
  18. 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
  19. 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
  20. 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
  21. 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
  22. Envoyer offers 4 Zero downtime deployments 4 Seamless rollbacks 4

    Cron jobs monitoring with heartbeats 4 Deployment health status
  23. 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
  24. 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
  25. 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
  26. 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
  27. Some prominent community members 4 Taylor Otwell 4 Jeffrey Way

    4 Eric Barnes 4 Graham Campbell 4 Matt Stauffer 4 Dayle Rees
  28. Dan Syme @dansyme 4 Owner of Cartalyst cartalyst.com 4 Blogger

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

    fruitcakestudio.nl 4 Creator of Laravel Debugbar, Laravel IDE Helper, and many other packages
  30. Talk to fellow Artisans when you're stuck #laravel on IRC

    Larachat.co stackoverflow.com laracasts.com/discuss laravel.io
  31. Open-Source isn't only about opening up your code to others

    It's also about opening up yourself to others
  32. 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