What is all this Laravel stuff anyway?
Laravel offers an array of useful tools and satellite services. But sometimes it can be a bewildering field.
Laravel started off as a framework, but by now it has become as much an ecosystem as a framework. And the tendency to use fairly vague names can make that ecosystem more than a little hard to navigate. I thought it might be an idea to take a look at the pieces and see what they do and are.
Laravel
Category: Framework | Availability: Built In | Cost: Free
Obviously needing little introduction, Laravel is a framework for PHP. It has quickly become arguably the biggest framework in the PHP world, not least because of a gentle difficulty curve eased by excellent learning resources.
Laravel also has an excellent technical ceiling. While trivial things can be done easily, highly advanced functionality is also readily available.
Eloquent
Category: ORM | Availability: Built-In | Cost: Free
Eloquent is an ORM for Laravel, and the default way to connect to databases. It allows a consistent interface, regardless of the database type, and facilitates highly expressive querying that hides the SQL clutter caused by table joins and similar relationships.
Artisan
Category: Command Line | Availability: Built-In | Cost: Free
Artisan is a Command Line Interface (or CLI) that drives a lot of functionality in Laravel. Most critically it handles migrations and generation of some boilerplate. It also acts as something called an REPL, allowing you to test functionality such as Eloquent calls directly in the command line.
Blade
Category: Template | Availability: Built-in | Cost: Free
Blade is the name given to Laravel’s templating engine. It’s a cross between Twig and .NET’s Razor template syntax. Blade templates are easily composed and nestable, allowing developers to make small and expressive templates.
Homestead
Category: Development Tool | Availability: Install | Cost: Free
Laravel has reasonable requirements to run locally, but maintaining a local server with the correct setup, config, database access, etc, can be a bit of a pain. Homestead eliminates this pain, acting as a Virtual Machine. This VM is an entire operating system (Ubuntu, specifically) which makes unix standard command line tools and an effective server environment available to everyone, and consistent between developers on a team. It is especially useful for Windows users, who tend to typically encounter more friction and have more to install than MacOS or Linux developers.
Homestead is also configured in such as way that if used in collaboration with other Laravel tools (especially Forge or Envoyer discussed later) it provides a quite seamless development experience.
Valet
Category: Development Tool | Availability: Install | Cost: Free
Exclusively available to Mac OS, Valet provides an alternative to Homestead above. Where Homestead provides a comprehensive development environment, Valet provides a bare minimum to run and share a range of Laravel (or any other) sites on a local machine. It even allows you to share sites over the internet. It presumes, as a result, that your local machine is properly capable, set up, and configured.
There isn’t a clear choice of whether to use Valet or Homestead at any given point, but for larger and more complex projects, Homestead is a better choice. Valet is intended as a simple tool for demoing a WIP or
Elixir
Category: Front End Build | Availability: Built In | Cost: Free
The goal of Elixir is to facilitate the process of handling front-end assets, such as Sass or Javascript files. It allows the automated compilation, minification, etc, of these sorts of resources.
Elixir is actually just a wrapper around Gulp, to make its rather complex API a little simpler to work with.
Mix
Category: Front End Build | Availability: Built In | Cost: Free
Gulp is a good solution, but Webpack is a more contemporary solution. Laravel Mix updates to the same general solution for Webpack in Laravel 5.4 and above. The user experience shouldn’t really be much if any different to Elixir.
Cashier
Category: Payment Handling | Availability: Package | Cost: Free
Cashier is a package to facilitate taking online payments. It most typically integrates with Stripe or Braintree. Cashier can handle subscriptions, coupons, discounts, and a huge amount of different functionality, and make it easy to set up.
Forge
Category: Deployment | Availability: Subscription | Cost: $15/mth
Services like Digital Ocean, Linode, and AWS provide the best utility and value for money in hosting currently. However, the process of purchasing, configuring, provisioning, and deploying to them can be less than streamlined. Forge provides a tool that allows these accounts to be created and (to a limited degree) administered. It also allows Github, Bitbucket, or whatever to be connected directly to the environment. This lets Forge act as a deployment system. Pushes to Origin can be deployed straight to the server, including running any migrations.
This is the first Laravel utility we’ve seen that has an associated cost. As ever, decisions on whether this is worth paying are up to the individual. But for me that $15 a month is a bargain compared for the benefits, especially for someone who routinely provisions this kind of system.
As mentioned in the Homestead section, it also ties in very nicely with that tool, making for a nice workflow. In fact, the environment Forge sets up on the server is a Homestead box, so it’s guaranteed to work.
Envoyer
Category: Deployment | Availability: Subscription | Cost: $10/mth
The difference between this and Forge isn’t obvious at first glance. Or second. Essentially, Forge is a system to do provisioning of online cloud servers. As an aside it can be used for basic deployment. Envoyer is a dedicated deployment solution, that allows a much wider range of behaviours and customisations. It creates zero-downtime deployments, and has the ability to roll back or switch between deployment packages.
Envoyer can be happily used in collaboration with Forge in the case of regular new servers, or on its own, in an established environment needing regular deployment.
Envoy
Category: Server Tasks | Availability: Built In | Cost: Free
Envoy is a server based task runner. Task lists are written in a syntax very similar to Blade, it’s even called a Envoy.blade.php, and they can then be run directly on the server. Git pull, artisan migrate, copying image files, that sort of thing.
Envoyer above makes extensive use of this core, but it can be used separately.
Echo
Category: Event Broadcast | Availability: NPM Package | Cost: Free
The goal of Echo is to make it easy for JavaScript applications to get access to events emitted by a Laravel application. It’s a JavaScript library that lets you set up a listener for channels that Laravel can broadcast on.
This is intended to make it simpler to build more real-time applications with Laravel, and is certainly a better option than repeatedly polling an API.
Socialite
Category: Authentication | Availability: Package | Cost: Free
There are a large number of APIs available for consumption with modern applications. The vast majority of them the ability to authorise against them using OAuth. The protocols for OAuth can be tricky to work with, and the flow of them is not simple.
What Laravel Socialite allows is the creation of Providers, which wrap up the process of logging onto these OAuth services and conforming their authentication and authorisation processes to a standard set of functions.
Socialite supports Facebook, Github, Twitter, Google and Bitbucket logins by default, but common third party providers such as Reddit, LinkedIn, or even Strava are easily available.
Passport
Category: Authentication | Availability: Package | Cost: Free
At a glance this functionality looks like Socialite. Both handle social media OAuth authorisations. The difference is that Socialite facilitates you logging in to an OAuth system, and Passport facilitates you being an OAuth system.
The utility of this is of very limited scope, but it’s good to know it’s an option.
Scout
Category: Search | Availability: Package | Cost: Free
Writing good search functionality is not as easy as it seems. Simple options such as sql LIKE
don’t really offer the richest experience, and full-text indices are a major pain to set up and for only moderate gain. There are, however, existing solutions for searching that are available as Search as a Service options. Scout’s default is Algolia, and search support can be added as simply as the addition of a trait to an existing Eloquent model.
Note that while Scout itself is free, the Algolia service is not. Its starter package is nearly $50 a month. Search would need to be a significant part of your site’s functionality to justify this cost.
Lumen
Category: Framework | Availability: Package | Cost: Free
Often billed as a “micro-framework”, Lumen is more easily thought of as a framework for micro-services. It is lighter and faster than Laravel, while containing a lot of the same functionality. In particular it contains things like Laravel’s excellent ORM, Eloquent.
The upgrade path from Lumen to the full install of Laravel is reasonable, so it’s a solid option for someone just wanting to build a small API or whatever.
Dusk
Category: Testing | Availability: Built-In | Cost: Free
Laravel has long had excellent support for BDD-style acceptance testing. Unfortunately, more JavaScript applications are difficult to test. The timings and delays caused by JavaScript aren’t particularly easy to handle in a back-end language like PHP.
Dusk is intended to plug that gap, added in Laravel 5.4. It makes behavioural testing JavaScript-heavy apps as simple as static apps.
Spark
Category: Turnkey Frontend | Availability: Purchase | Cost: $99
Spark is a pre-built site intended as a frontend for a subscription service. It’s a turnkey solution, ready to go with your design changes and addition of stripe API keys and a few basic settings. Spark is essentially a Laravel application, with JavaScript functionality in VueJS, Stripe billing pre-configured, user login, and a flexible, contemporary interface.
Like other non-free Laravel options, a rational assessment needs to be made about whether the price warrants the purchase. And like many other non-free Laravel options this is largely a no-brainer. It would certainly cut many hours off the setup of such a site front-end and represents an excellent RoI.
Horizon
Category: ?? | Availability: ?? | Cost: ??
God only knows what this is. Laravel creator Taylor Otwell has hinted this on Twitter recently. He described it as “getting spooky”. Speculation that it’s a Javascript Framework was laughed away, but suggestion that it’s a backend admin functionality is more likely. In truth it’s hard to look at the above list and see a gap Laravel needs to fill. Time will tell!
Laracasts
Category: Training | Availability: Subscription | Cost: $9/mth
The only thing on here that’s not an official resource, Laracasts is the next best thing. Jeffrey Way’s in-depth tutorials are a big portion of the success of Laravel as a platform, as they help people get into it.
Though listed as $9 a month above, many of Laracast’s most useful videos are actually free. If using Laravel extensively, a Laracasts subscription is a must.
That’s a quick look at all of the add-ons and components that populates the Laravel ecosystem. Hopefully that helps clarify some which are a bit unclear, or that you’ve just heard mentioned. There’s a ton of stuff Laravel offers, and anything that can un-muddy the water might well help a lot of people.