As Laravel has grown, Taylor has built a suite of tools to support and simplify the lives and workflows of Laravel developers. Much of the new work has gone straight into the core, but there are quite a few packages and SaaS (software-as-a-service) offerings that aren’t a part of the core, but are still very much a part of the Laravel experience.
We’re already covered quite a few in this book, so I’ll link to each; but for those we haven’t covered, I’ll give each a quick description and a link to the relevant website.
We’ve already taken a look at these, but here are links to where you can find them in the book.
The Laravel installer is a package installed globally on your local development machine (via Composer) that makes it easy and quick to set up a new Laravel project.
Covered in “Installing Laravel with the Laravel Installer Tool”.
Valet is a local development server (for Mac, but with forks for Windows and Linux) that makes it quick and easy to serve all of your projects to your browser with almost no effort. You’ll install Valet globally on your local development machine via Composer.
With a few commands you can have Nginx, MySQL, Redis, and more serving every Laravel app on your machine at a .test domain.
Covered in “Laravel Valet”.
Passport is a powerful, simple-to-set-up OAuth2 server for authenticating clients to your APIs. You’ll install it in each application as a Composer package, and with very little work you can have a full OAuth2 flow accessible to your users.
Covered in “API Authentication with Laravel Passport”.
Horizon is a queue monitoring package you can install into each application via Composer. It exposes a full user interface for monitoring the health, performance, failures, and history of your Redis queued jobs.
Introduced briefly in “Laravel Horizon”.
Mix is a Webpack-based frontend build system. It can run Babel, Browsersync, your favorite CSS pre- and post-processors, and provides hot module replacement, code splitting, versioning, and much more. Mix replaced Elixir, a Gulp-based tool used for the same purposes.
Covered in “Mix”.
Echo is a JavaScript library (introduced along with a series of improvements to Laravel’s notification system) that makes it simple to subscribe to events and channels broadcast from your Laravel app via Websockets.
Covered in “Laravel Echo (the JavaScript Side)”.
Dusk is a frontend testing framework built for testing your entire application, JavaScript and all. It’s a powerful package you can pull into your application via Composer and that drives actual browsers with ChromeDriver.
Covered in “Testing with Dusk”.
Homestead is a configuration layer on top of Vagrant that makes it simple to serve multiple Laravel applications from a Laravel-friendly Vagrant setup.
Introduced briefly in “Laravel Homestead”.
These are a few tools that I did not cover because they are beyond the scope of this book. Some of these are just for use in special circumstances (Cashier for taking payments, Socialite for social login, etc.) but some I use every day (Forge, especially).
Forge is a paid SaaS tool for creating and managing virtual servers on hosts like DigitalOcean, Linode, AWS, and more. It provisions Laravel-ready servers (and individual sites on those servers) with all the tools you need to run your servers, from queues and queue workers to Let’s Encrypt SSL certs. It can also set up simple shell scripts to auto-deploy your sites when you push up new code to GitHub or Bitbucket.
Forge is incredibly useful for spinning up sites quickly and easily, but it’s not so minimal that you can’t also run your apps on it longer term or at larger scale. You can scale up your server sizes, add load balancers, and manage private networking between your servers, all within Forge.
Envoyer is paid SaaS that’s branded as “Zero downtime PHP deployment”. Unlike Forge, Envoyer doesn’t spin up your servers or manage them. Its primary job is to listen to triggers—usually when you push new code, but you can also manually trigger deploys or trigger them with webhooks—and perform your deploy steps in response.
There are three ways that Envoyer does this much better than Forge’s push-to-deploy tool and most other push-to-deploy solutions.
It has a robust toolset for building out your deploy pipeline as a simple but powerful multi-stage process.
It deploys your app using Capistrano-style zero downtime deploys; each new deploy is built into its own folder, and only once the build process has completed successfully is that deploy folder symlinked to your actual web root. Because of this, there’s no moment when your server is broken while Composer installs or NPM builds.
Because of this folder-based system, it’s easy and quick to roll back any breaking changes to a previous release; Envoyer just updates the symlink back to a previous deploy folder and it’s immediately serving an older build.
You can also set up regular health checks (pings against your servers that report errors to you if the pings don’t get back a 200 HTTP response), expectations that your cron jobs will ping Envoyer on a regular schedule, and chat-based notifications of any significant events.
Envoyer is more of a niche tool than Forge. I don’t know many Laravel developers who don’t use Forge; but those who pay for Envoyer are more likely to have websites that will suffer if they can’t immediately roll back a problematic commit, or who get enough traffic (or important enough traffic) that 10 seconds of downtime here and there can be a big issue. If your site is in that category, Envoyer will feel like magic.
Nova is a paid package for building admin panels. If you imagine your average complex Laravel app, it may have a few parts: the public-facing web site or customer view, the administration section for making changes to the core data or customer list, and maybe an API.
Nova drastically simplifies the process of building the admin panel aspect of the site using Vue and a Laravel API. It makes it easy to generate CRUD (Create, Read, Update, Delete) pages for all of your resources, together with more complex custom views for your data, custom actions and relationships on each of your resources, and even custom tools for adding non-CRUD tooling to the same general admin space.
Spark is a paid package for generating a SaaS that accepts payments and makes it easy to manage users, teams, and subscriptions. It provides Stripe integration, invoices, two-factor auth, profile photos for your users, team management and billing, password resets, announcements, API token authentication, and more.
Spark is both a series of routes and a series of Vue components. You’ll use Spark to scaffold the basis of a new project, so don’t plan to add it to your existing apps after-the-fact.
Lumen is a free API-focused micro-framework built from Laravel parts. Because it’s for APIs, many of the conveniences Laravel offers that target non-API calls (for example, Blade templating) have been stripped out.
That makes a leaner framework with a few less of the niceties, with the benefit of speed improvements.
My general approach to Lumen is that, unless you have built APIs in Laravel and found them too slow, or unless you’re definitely building a microservice-style API that will absolutely never have need for any views or any of the other niceties Laravel offers, you should stick with Laravel.
But when you find yourself developing microservice-style APIs in Laravel and you need to eke out more speed at the millisecond level, that’s the right time to look at Lumen.
Cashier is a free package that provides a simple interface in front of Stripe’s and Braintree’s subscription billing offerings. Cashier handles much of the basic functionality of subscribing users, changing their plans, giving them access to invoices, handling webhook callbacks from the billing service, cancellation grace periods, and more.
If you want to allow your users to sign up for subscriptions using Stripe or Braintree, Cashier will make your life a lot easier.
Socialite is a free package that makes it incredibly simple to add social login (for example, GitHub or Facebook) to your apps.
Envoy is a local task runner that makes it easy to define common tasks that will run on your remote servers, commit those tasks’ definitions to version control, and run them simply and predictably.
Take a look at Example 18-1 to get a sense for what a common Envoy task looks like.
@servers(['web-1'=>'192.168.1.1','web-2'=>'192.168.1.2'])@task('deploy',['on'=>['web-1','web-2']])cdmysite.comgitpullorigin{{$branch}}phpartisanmigratephpartisanroute:cache@endtask
To run Example 18-1, you’d run the following command from your local terminal:
envoyrundeploy--branch=master
Telescope is a free debugging tool, installable as a package, for Laravel applications running Laravel 5.7.7+. It generates a dashboard where you can dig into the current status of jobs, queue workers, HTTP requests, database queries, and much more.
I’ve mentioned these resources already, but here’s a non-exhaustive list of resources folks often turn to to learn Laravel.
@TaylorOtwell and @LaravelPHP on Twitter
The many Laravel chats; at the time of writing this book, the Laravel Discord server is the primary location where Taylor and other contributors are accessible, but there’s also unofficial chats in Slack and IRC (#laravel on Freenode)
There are many blogs (I have one at mattstauffer.com and Tighten has one at tighten.co, and there are plenty of others that are incredibly useful), many excellent Twitter-ers, many excellent package authors, and far too many Laravel practitioners who I respect to fit into a list here. This is a rich, diverse, and giving community, full of developers who love to share everything they’re learning; the hard part is not finding good content but finding the time to consume it all.
Like I wrote above, I can’t list every person or resource you should look to in your journey as a Laravel developer. But if you start with the resources and folks listed above, you will be off to a great start in getting up and running with Laravel.