---
title: Real-time monitoring for Laravel applications
url: "https://aaronfrancis.com/videos/real-time-monitoring-for-laravel-applications"
path: "/videos/real-time-monitoring-for-laravel-applications"
type: video
author: Aaron Francis
published: 2024-06-07
topic: "Laravel & PHP"
keywords: [laravel top, real-time monitoring, laravel, monitoring tool, request monitoring, performance monitoring, cache customization, database customization, laravel pulse, application monitoring]
youtube_url: "https://www.youtube.com/watch?v=DTEAN5ADfhs"
site_index: "/llms.txt"
keyword_index: "/llms/keywords.txt"
---

# Real-time monitoring for Laravel applications

## Chapters

- Laravel Top Introduction
- Send a Test Request
- Customizations for Cache
- Customizations for Database
- Uses of Laravel Top
- Alternative - Laravel Pulse

## Transcript

**Aaron Francis:** Today, I wanna highlight a third-party package that helps you monitor your Laravel applications. I know I talk a lot about first-party packages, but there are even more good third-party packages. So I'm gonna show you Laravel Top as a way to keep track of what's going on in your application real time. Let's get started. I'm gonna start by saying Laravel new top, and we'll do no starter kit.

**Aaron Francis:** No, we don't need any of that. This is gonna download and install Laravel for me and create a new project, and we'll choose SQLite, and we'll change into Top, and I think it migrates for you. Yeah, there's nothing to migrate. After that, we're gonna composer require, uh, leventcz, don't really know how to pronounce that, slash laraveltop.

**Aaron Francis:** So we're gonna pull that in, and then we can open this in PhpStorm and start poking around. Actually, let's go ahead and publish. I think it's vendor publish, and is there a... Yeah, let's publish whatever they have in there. So there is a configuration file, which means we can go take a look at some stuff. So let's open this in PhpStorm, and go to the config file and see if there's anything good there.

**Aaron Francis:** Um, looks like you can change your Redis connection or change recording mode. Uh, I don't think we're gonna do either of those things right now. Let's go to our ENV file. My Redis connection is on 6380 because it's powered by Laravel Herd. And so if we open up Herd and look, we see 6380.

**Aaron Francis:** So I need to change that to 6380, and I have. Laravel Top is a way to monitor some high-level stuff about your application, including request response time, database query time, cache hits and misses, et cetera. Um, the way that it works is it listens to Laravel's native events, of which there are many, and Laravel fires these events for a query completed or a cache hit or miss or response, uh, sent, that sort of thing.

**Aaron Francis:** So it listens to all of those and then writes it into Redis, and then gives you this command where you can watch it. So if you run PHP Artisan Top, you see that you're sent into this little dashboard. So it's continually running, but we're not sending any requests yet. But if we were to send some requests just to top.test, you'll see stuff starting to fly in here.

**Aaron Francis:** This is super cool. So you see it's live updating. We get requests per second over here, um, queries, cache. We're not running any cache yet, uh, so let's go ahead and add a few things. Let's come over into web.php, and we'll duplicate this guy and call that cache and return, uh, how do we wanna do this?

**Aaron Francis:** Let's go ahead and make a key of key RANDBETWEEN one and 100, and we'll return cache-remember. So we'll populate it if it's not there for now, plus how many seconds? AddSeconds. Let's do RANDBETWEEN, I don't know, two and 10 seconds, and then the callback is gonna just be cached.

**Aaron Francis:** So this is going to pull it out of the cache, or if it's not there, populate it in the cache, um, and store it for between two and 10 seconds. So now we should see some cache hits and misses. Um, let's go ahead and, not that one, this one. Let's fire that up there again, and we can fire it up on cache as well.

**Aaron Francis:** So we'll see two routes are now being hit, and we see the hits and misses are starting to populate over there, which, this is pretty cool. I can see this being extremely useful on a real application. Let's do a database one as well. So here, we'll just call this DB, and this will be easy. We can just say, uh, DB select, select star from users.

**Aaron Francis:** Uh, semicolon outside simplify, uh, import, sure. And we'll just do that. So now we'll come back over here, and while those are running, we will also fire up some hits against the DB route, and we should see there's the DB route and the queries. There you go. They start to fly up.

**Aaron Francis:** This is a very cool way to monitor the web side of your Laravel application. It doesn't monitor queued jobs or commands, um, but it does write all the data to Redis. So if you do have multiple servers, multiple web servers, this will aggregate all of that data together because it's writing it to a central repository, which is Redis. Um, another thing you could use to monitor your application is Laravel Pulse, which is a first-party package from the Laravel team.

**Aaron Francis:** It is similar in that it aggregates statistics, um, but puts it in a web dashboard, and also it makes it very easy to write your own, uh, aggregators. I have a video on creating a custom pulse card that you can watch here. Until the next time, see ya.

---

## Related on aaronfrancis.com

- [Ecosystem of Cards](/podcast/ecosystem-of-cards-45da2286) *(Podcast · 2023-12-06 · shared: laravel pulse, real-time monitoring)*
- [About](/about) *(Page · 2026-11-25 · shared: laravel)*
- [Now](/now) *(Page · 2026-11-25 · shared: laravel)*
- [Biggest Week In Laravel History](/podcast/biggest-week-in-laravel-history-cfbcddfa) *(Podcast · 2026-11-24 · shared: laravel)*
- [Oops!...Ian Did It Again](/podcast/oopsian-did-it-again-8cf7ed7d) *(Podcast · 2026-11-17 · shared: laravel)*

## Relevant Resources from Aaron Francis

- **[Solo](https://soloterm.com)** (overview on site: [/software](/software)): All-in-one agentic development platform and terminal workspace built by Aaron Francis for orchestrating processes and AI coding agents.

## Search aaronfrancis.com (2-Hop Static Keyword Index)

Pick the alphabetical shard matching any topic to find exact pages across all articles, newsletters, videos, talks, and podcast transcripts (every shard is < 40 KB):
[A-B](/llms/keywords/a-b.txt) · [C](/llms/keywords/c.txt) · [D-E](/llms/keywords/d-e.txt) · [F-G](/llms/keywords/f-g.txt) · [H-J](/llms/keywords/h-j.txt) · [K-L](/llms/keywords/k-l.txt) · [M-N](/llms/keywords/m-n.txt) · [O-P](/llms/keywords/o-p.txt) · [Q-R](/llms/keywords/q-r.txt) · [S](/llms/keywords/s.txt) · [T-Z](/llms/keywords/t-z.txt) · [Directory](/llms/keywords.txt) · [Site Map](/llms.txt)

Shards for this page's topics: `laravel top` ([K-L](/llms/keywords/k-l.txt)), `real-time monitoring` ([Q-R](/llms/keywords/q-r.txt)), `monitoring tool` ([M-N](/llms/keywords/m-n.txt)), `performance monitoring` ([O-P](/llms/keywords/o-p.txt)).

## About Aaron Francis (Current Context)

Aaron Francis is VP of Marketing and Community at [Laravel](https://laravel.com), founder of [Try Hard Studios](https://tryhardstudios.com), creator of [Solo](https://soloterm.com), co-host of [Mostly Technical](/podcast), and author of [Mastering Postgres](/courses), [High Performance SQLite](/courses), [MySQL for Developers](/courses), and [Screencasting.com](/courses). Full bio: [/about](/about) · Current focus: [/now](/now).
