Optimising Laravel Cloud

Last updated on 17th November 2026

Ok, it’s a bit of a click-baity title. Laravel Cloud isn’t unoptimised, and reducing your Laravel Cloud spend isn’t so much doing special things for the platform. Instead, it’ll require fixing problems your previous host was subsidising. Being a better developer.

I wanted to write these things down to remind my future self, and maybe help some developer friends save money too.

I have been working relentlessly on reducing my Laravel Cloud spend, ever since deciding to move all my web things to it. I’ve mostly been remembering to fix holes I was able to ignore on old hosts. Locking down which URLs will respond to bot traffic. Making pages send less data over the wire. Using cache in many more places.

There are two things I’d recommend you do:

  1. Disallow any routes your app shouldn’t serve, via Cloudflare security rules. I made a Composer library to do only this: assertchris/cloudflare-security-rule-sync. There are other libraries that do something similar. Whichever you choose to use, blocking sniff traffic is going to save you a lot of money.
  2. Regularly find the slowest, busiest URLs (Monitoring -> Requests) and optimising them.

This post is about the latter. I got tired of looking through each app to find the slowest URLs; so today I made a reusable skill to do the following:

  1. Get all Laravel Cloud apps
  2. For each, get the metrics and find the slowest URLs
  3. Look in GitHub for open or recently merged URLs that address these slow URLs
  4. If novel work can be done, inspect the code responsible for responding at the problematic URLs
  5. Suggest improvements that can be made for each, or confirm there is ongoing work that deals with them

It uses a few tools that are specific to my setup. First, there’s the tool to fetch local paths for a given GitHub repo. This is so that I don’t have to hard-code paths and URLs. I have a dynamic list of these and the tools surface that in a reusable way.

Secondly, I have a series of GitHub and Laravel Cloud MCP-esque tools I have made. The way I like to do this is by keeping the tokens/credentials for these services in an API my agent does not have access to. I have posted about this in the past, but the quickest recap I can give of it is: I made Shell to limit what the bots can do without my permission or with un-scopable credentials.

I have open-sourced Shell, so you can either base your tools on it or self-host it: assertchris/shell.assertchris.dev. Pull requests are welcome, but I will ruthlessly deprecate tools for services I do not actively use. That’s the only way I can maintain good, working software of this nature.

That’s it. The skill is at assertchris/claude-skills. Hope it helps!