The Laravel Ecosystem

Posted on March 17, 2017

reading time

Now on version 5.6, Laravel was first released in 2011 with limited functionality, but quickly gained traction due to the clean and elegant syntax.  Laravel was created to add in the functionality that CodeIgniter, the most popular framework at the time, was missing.  Lots of other frameworks had this missing functionality, but were missing the thorough documentation and code cleanliness.

Move on to 2017 and Laravel is the most forked and starred PHP framework on Github, with double that of the second-place (Symfony).  Laravel has also evolved greatly as a product and now isn't just a framework, but a full ecosystem of components and services.  In this article we'll take a look at some of these.

Lumen

Lumen is a micro-framework built using many of the components that Laravel itself uses.  The aim of the framework is speed, and it boasts some of the fastest response times in the industry.  As such, Lumen lends itself extremely well to lean APIs, allowing developers to build standalone APIs for their applications.

Spark

Laravel Spark is a SaaS scaffold.  After installing Spark you're left with a working application that allows users to view a few pages, view a list of your plans, sign up to a subscription, login and make amends to their account, view invoices and even features a full admin area where you're able to view, manage and impersonate your users.

Spark was built to help developers who want to build their own SaaS applications but lose motivation when they need to spend days (weeks?) on the 'boring' stuff such as billing and authentication.  Spark just sorts all of that out, and allows a good amount of customisation around plans, such as the ability to create teams, free trials, no-card-upfront subscriptions, and even API token creation.

There is a cost though - which is slightly controversial as the pre-release of Spark was free - at $99 per site or $299 for unlimited website.  For me this is a tiny cost for something sturdy and robust that will save a huge amount of time, and keep you motivated to finish your project.

Homestead

Homestead is a lightweight virtual machine built using Vagrant.  It allows the developer to quickly get a working environment up and running for a Laravel application, something that can be a little tedious and frustrating on macOS due to their out-dated version of Apache that ships natively and without PHP or MySQL support.

Homestead comes with nginx, MariaDB, git, redis, memcached and the latest version of PHP.  Run the installer, link it into your VM, and you're done.  The VM workflow is a bit of a life saver when you work on a number of different projects with different environment requirements as they are all isolated from one another, Homestead makes that incredibly easy to do.

Valet

Valet is a Mac-only stripped back version of Homestead.  It's super-simple but super effective.  You can spin up sites really quickly and easily, share them over your network, and all with a tiny footprint (around 7MB RAM, according to the docs).

Cashier

Laravel Cashier is subscription billing for Laravel made simple.  Spark uses Cashier under the hood to power its payments, so Cashier enables you to integrate many of the Spark billing functionality into your app.

Cashier supports Stripe and Braintree and is geared at subscriptions and user-based payments.  You can bill your users monthly, annually, add in trials and create one-off payments.  If you're building a SaaS application then Cashier probably has you covered.  It isn't really suitable for one-off payments though.

Laravel Mix

Laravel Mix is a replacement for Gulp and allows you to compile your assets ridiculously quickly.  Under the hood Mix uses Webpack to compile your Sass or Less, move and minify your assets and manage your asset versioning.

You can use Mix to define your own workflow, but the first thing you'll notice is the speed.  Gulp is quick, but before Mix there were hundreds of packages being accessed with each compile, and this slows things down (~2s build on a good machine).  But with Mix there basically is no build time; you hit save and everything is done.  It even supports Browser Sync out of the box.

Laravel Forge

Forge allows you to provision and deploy cloud servers across multiple different cloud services, including DigitalOcean, Linode, AWS or a custom provider.  Just point it at your repo, select your server size, and click deploy.

Forge also integrates nicely with LetsEncrypt to provide free SSL certificates for your projects and handles all of the set up of Laravel features such as queues and scheduling.

Envoyer

Envoyer allows you to deploy your code to servers quickly and easily, and then monitors your applications and servers programatically.  There is a little cross-over of features with Forge, but if you take a look at the screenshots of the two systems you will see how they both differ greatly.

Conclusion

Laravel has come a long way in the last 5 years, and it is miles away from its competition in terms of its community and official products.  There are some great packages available that aren't covered in this article, such as Scout that allows full-text searching from third parties (think Algolia and Elastic Search) by simply including your API keys and calling search() on a model, or Passport that allows developers to create their own OAuth server, which is a huge headache removed when creating app backends.

I'm excited to see what Laravel becomes in the coming years.  It's clear to me that Laravel will need more input from other developers as it grows, as it is currently Taylor Otwell's baby, and although that keeps things clean and allows for controlled growth, it doesn't scale well.  We're already starting to see other official packages that are owned and managed by other developers, such as Mix, so I'm sure it won't be a problem.

If you have any comments or questions please feel free to reach out to us on Twitter.