The PHP podcast where everyone chimes in.

Originally aired on

April 27th, 2017

062: All things Laravel

We chat all things about the Laravel ecosystem.

with


All things Laravel Show Summary


What to expect as a new Laravel person

  • Laravel is a full featured framework for PHP that has pretty much most of what you need to develop a modern web app
  • Some things that includes: * Routing: Inspired by Sinatra. Similar to Slim and Silix * ORM: Called Eloquent that is inspired by the Ruby on Rails implementation of the Active Record design pattern * Unit testing * Message queue library * Support for Web Sockets * Laravel Mix: Makes working with Webpack much easier
  • Geared for Rapid Application Development because the syntax is really simple and intuitive
  • Strives to have good documentation; if you can learn it quickly, then you can build it quickly

What is the best place to get started learning about Laravel?

How does Taylor keep up with the ridiculous amount of PRs?

  • Taylor gets to work on Laravel full time
  • Has a Github page that has a list of all the PRs across all of the repositories
  • Tries to keep the list of PRs down to 10-15
  • Checks the PRs everyday for like an hour

Has there ever been anything you wanted to implement in the framework that has been hindered by the PHP language itself?

  • Real threads. Even though the pthreads extension exists, it is not common for it to be available
  • Some collection / iterable things can't be passed into array_map or array_filter. You have to cast the object to an array before you can use it with those functions.

Laravel has hired its first employee

  • It is Mohamed Said
  • He has been on staff for roughly 6 months

What is a typical day for employee #1 like?

  • Usually starts the day looking at the Github issues and pull requests and triage them
  • Tests new code on different environments
  • Looks at tasks in the various Laravel projects and sees what needs to be worked on
  • Lately have been studying Laravel Horizon; a project that is soon to be released
  • Spends an hour or two experimenting with new features Mohamed has in mind. Checks Laracasts forums to see if he can write a blog article that can help developers understand something better

What kind of influence has Laravel had on Adam's success?

  • Lucky to be involved in a big community that is excited to learn new things and the same things he is working on

Tools Adam finds exceptionally helpful when launching new products

  • ConvertKit - An email marketing automation tool. Makes it real easy to collect email address from people interested in your projects

Refactoring to Collections

  • Adam wrote a book about it
  • Started the book when he started to discover some of the functional features of PHP

What is tap and the higher order tap?

  • The function tap allows you to pass in an object as the first parameter and a callable, like an anonymous function, as the second parameter.
  • More info on tap here. PR for higher order tap here
  • Was originally in Rails, but then added to the Ruby language. This is where the inspiration came from for the Laravel implementation

New way to do Laravel Migrations in 5.5

  • Some people think the down method in migrations is useless, specially in production, which can be dangerous
  • Now down is optional in 5.5
  • New db:freash command which drops all the tables and reruns all of the migrations. This way you do not need to write any down methods, which might save some time

How does Laravel deal with the slowness that comes with the Reflection API?

  • You usually do not resolve enough stuff in a request to experience the slowdown. If you look at a controller, you might only have like 3-4 dependancies.
  • Haven't done anything special in the framework to mitigate the slowness
  • Taylor's first open source project was a reflection based DI container he wrote back in 2010. It was written for the Code Igniter community. The container in Laravel is similar to the one he wrote years ago.

Whats a good way to decouple routing with the container?

  • They are integrated at that point, so you just have to deal with it

Laracasts

Any advice on creating your own screencast business?

  • You need to update it often
  • If you are in the content business, you need a steady stream of stuff
  • When building a site, if you use 3rd party packages, make sure you trust the maintainer. You don't want them to end support and you are stuck with their old code

What is the typical upgrade path of the Laracasts site?

  • Usually updates at every minor release
  • Probably updates more often than many other Laravel production environments

Why Laravel 5.5 instead of 6?

  • Laravel uses a slightly different versioning scheme, which is laid out in the documentation
  • Major numbers are used when there is a paradigm shift in the framework
  • As of the time of the recording, there is no plan for Laravel 6. The Laravel 5 architecture and structure has been working out and there is no need to change everything.
  • For minor releases, the second number in the the release version, some minor breaking changes can be introduced. Taylor's guideline is to try to keep the changes low enough that a developer can update to the latest minor release within a day's worth of work

What is Laravel.io?

  • It started out in 2013 with Shawn McCool as the original maintainer. Now maintained by Dries Vints
  • Laravel.io is a discussion forum for developers
  • The source code for the site is on Github
  • The next version of the site should come out a month or two after this recording. It is a total rewrite

A Docker based solution like Laravel Homestead or Laravel Valet

  • There is nothing official, but Laradock is the closet thing
  • It is very common that people roll their own solution

Other Laravel Stuff

  • Spark A SaaS framework
  • Lumen A micro framework based on Laravel
  • Bunch of official packages * Cashier Help with doing billing and subscriptions using either Stripe or Braintree * Envoy A remote task runner. It can SSH to a box and run commands * Passport A Oauth2 server implementation for Laravel * Scout Adds full-text search to Eloquent models * Socialite Social Media authentication. Providers like Github, Facebook, Twitter, built-in. Lots of community driven providers listed here

Laravel Sneak Peak

  • Horizon will come out at Laracon 2017
  • Next big thing might come out at the end of 2017, but most likely 2018

Sammy Kaye wraps up with

Adam Wathan


Jeffrey Way


Taylor Otwell


Dries Vints


Mohamed Said


Developer Shout-Out

The Developer Shout-Out recognizes developers in the community for their contributions.

For this episode the panel guests, Adam, Jeffrey, Taylor, Dries, and Mohamed nominated Marcel Pociot for the Developer Shout-Out segment.

Thank you, Marcel Pociot for your work on @botman_io. A $50 Amazon gift card is on its way to you.

$50 Amazon gift card sponsored by Zend Training

Zend Training

Professional Training for Professional PHP developers

Show Notes Credit

Thank you Chris Thomas for authoring the show notes for this episode!

If you'd like to contribute show notes and totally get credit for it, check out the show-notes repo!