---
title: "Laravel Time Machine: A Request Lifecycle Profiler"
url: https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-eh757oqrk
source_url: https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-eh757oqrk
type: freeform
source: "jaydeep Gadhiya"
author: "jaydeep Gadhiya"
published: 2026-08-06T07:19:15.567Z
updated: 2026-08-06T07:19:15.567Z
upvotes: 2
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel Time Machine: A Request Lifecycle Profiler

**[jaydeep Gadhiya](https://daily.dev/sources/azeera5h4mezjuxrmqgol)** · [@jaydeepgadhiya](https://daily.dev/jaydeepgadhiya) · 2 upvotes · 0 comments

## Content

Laravel Time Machine is a performance profiler by [**@jaydeepgadhiya**](https://github.com/JaydeepGadhiya) that records every stage of a Laravel request — bootstrap, middleware, routing, controller, response, and termination — with millisecond timings. It answers one question: where did the time go in this request?

Here's what the package gives you:

- **Lifecycle timeline** — a Gantt-style breakdown of each request phase, from framework boot through the `terminate` step.
- **Query capture** — every SQL statement with bindings, connection, and execution time, toggled via `collectors.queries`.
- **Slow highlighting** — requests over 500ms and queries over 50ms get flagged, with both thresholds configurable.
- **Flat-file storage** — profiles are plain JSON files in `storage/time-machine`; no database tables or migrations.
- **Ignore patterns** — asset requests and paths like the Telescope dashboard are skipped via `ignore_paths`.
- **Debug-only by default** — the profiler follows `APP_DEBUG`, so it stays off in production unless you enable it.

## [#](https://laravel-news.com/laravel-time-machine-a-request-lifecycle-profiler#content-the-timeline-dashboard)**The Timeline Dashboard**

Once installed, the package records every HTTP request automatically and serves a self-contained dashboard at `/time-machine` when enabled. Each request gets a visual timeline showing how long the application spent in each lifecycle phase, alongside memory usage and query counts. Requests that cross the slow threshold (500ms by default) are highlighted so bottlenecks stand out in the list of recent profiles.

## [#](https://laravel-news.com/laravel-time-machine-a-request-lifecycle-profiler#content-custom-instrumentation)**Custom Instrumentation**

Beyond the automatic lifecycle phases, you can instrument your own code through the `TimeMachine` facade. Drop point-in-time markers, wrap a block in a measured closure, or control spans manually:

```
use Jaydeep\LaravelTimeMachine\Facades\TimeMachine;
```

` `

`// Drop a marker on the timeline`

`TimeMachine::mark('cache primed');`

` `

`// Time a code block`

`$report = TimeMachine::measure('generate-report', function () {`

`return Report::build();`

`});`

` `

`// Manual span control`

`TimeMachine::startSpan('external-api');`

`$response = Http::get('https://api.example.com');`

`TimeMachine::endSpan('external-api');`

Custom spans appear on the same timeline as the framework phases, so you can see how a slow external API call or report generation fits into the overall request.

## [#](https://laravel-news.com/laravel-time-machine-a-request-lifecycle-profiler#content-storage-without-a-database)**Storage Without a Database**

Profiles are written as JSON files to `storage/time-machine`, which means there are no migrations to run and the data never leaves your server. The package retains the most recent 100 profiles by default and prunes the oldest ones as new requests come in; the `storage.max_records` setting (or the `TIME_MACHINE_MAX_RECORDS` env variable) adjusts the limit.

## [#](https://laravel-news.com/laravel-time-machine-a-request-lifecycle-profiler#content-how-it-compares-to-telescope-and-debugbar)**How It Compares to Telescope and Debugbar**

There's some overlap with Laravel Telescope and Laravel Debugbar, but the three tools have different scopes. Telescope monitors many parts of an application — requests, jobs, mail, notifications, cache, and more — and stores its entries in the database.

Debugbar renders a toolbar inside the current page with timing and query data for that response.

Time Machine sits in between: it keeps a browsable history of recent requests like Telescope, but collects only lifecycle timing and query data, stores it in flat files, and presents it on a timeline. If you want full application monitoring, Telescope is still the better fit; if you're profiling where individual requests spend their time, that's the case this package is built for.

## [#](https://laravel-news.com/laravel-time-machine-a-request-lifecycle-profiler#content-installation-and-configuration)**Installation and Configuration**

The package supports Laravel 8 through 13, and installs via Composer with auto-discovery handling the service provider and facade:

```
composer require jaydeep/laravel-time-machine
```

Publishing the config file is optional:

```
php artisan vendor:publish --tag=time-machine-config
```

You can learn more about this package, get full installation instructions, and view the source code on the [**laravel-timemachine GitHub repository**](https://github.com/JaydeepGadhiya/laravel-timemachine).

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

[View this post on daily.dev](https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-eh757oqrk)
