<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-q5kpyurse" -->

---
title: Laravel Time Machine: A Request Lifecycle Profiler
description: Laravel Time Machine is a request lifecycle profiler package that records timing for each stage of a Laravel request—bootstrap, middleware, routing,...
canonical: https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-q5kpyurse
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Laravel Time Machine: A Request Lifecycle Profiler | daily.dev
og:description: Laravel Time Machine is a request lifecycle profiler package that records timing for each stage of a Laravel request—bootstrap, middleware, routing,...
og:url: https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-q5kpyurse
og:image: https://api.daily.dev/og/posts/q5kpyuRSE.png
og:image:alt: Laravel Time Machine: A Request Lifecycle Profiler
og:image:width: 1200
og:image:height: 630
og:locale: 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

**[Developer Nest](https://daily.dev/sources/devnest)** · [@jaydeepgadhiya](https://daily.dev/jaydeepgadhiya) · 3 min read · 4 upvotes · 4 comments

## Summary

Laravel Time Machine is a request lifecycle profiler package that records timing for each stage of a Laravel request—bootstrap, middleware, routing, controller, response, and termination—down to the millisecond. It captures SQL queries with bindings and execution time, flags slow requests (over 500ms) and slow queries (over 50ms), and stores everything as flat JSON files under storage/time-machine rather than in a database. A self-contained dashboard at /time-machine visualizes each request as a Gantt-style timeline, and developers can add custom markers, measured closures, or manual spans via the TimeMachine facade. The package follows APP_DEBUG so it stays off in production by default, supports Laravel 8 through 13, and is compared against Telescope (broader app monitoring) and Debugbar (in-page toolbar) as a narrower, request-timing-focused alternative.

## Content

Laravel Time Machine is a performance profiler by [**@jaydeepgadhiya**](https://daily.dev/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.maxrecords`_ setting (or the _`TIMEMACHINEMAXRECORDS` 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).

## Community discussion

Top comments from developers on daily.dev.

**@championempire** · 2 upvotes

> This is a really useful approach for Laravel performance debugging. Instead of only knowing that a request is slow, Time Machine helps pinpoint exactly where the time is being spent across the request lifecycle. The flat-file storage and custom instrumentation are especially nice for quickly profiling specific bottlenecks without adding database overhead.

**@championempire** · 0 upvotes

> Must try this package!! Great Work !

**@jay5699** · 0 upvotes

> This is a really useful approach for Laravel performance debugging.

## Similar posts on daily.dev

- [Laravel Brain: Visualize Your Application's Request Lifecycle](https://daily.dev/posts/laravel-brain-visualize-your-application-s-request-lifecycle-7nug7p59g) · Laravel News · 153 upvotes · 12 comments
- [Laravel Request Lifecycle Deep Dive: From Request to Response](https://daily.dev/posts/laravel-request-lifecycle-deep-dive-from-request-to-response-rsrs5vaao) · W endell Adriel · 40 upvotes · 7 comments
- [Build Custom Middleware for Query Performance Monitoring and Optimization in Laravel with MongoDB](https://daily.dev/posts/build-custom-middleware-for-query-performance-monitoring-and-optimization-in-laravel-with-mongodb-00xi7lueh) · Laravel News · 2 upvotes · 0 comments
- [The New Debug Bar for Laravel](https://daily.dev/posts/the-new-debug-bar-for-laravel-ucjxhtzdb) · Benjamin Crozat · 17 upvotes · 2 comments

---

Tags: [#laravel](https://daily.dev/tags/laravel), [#performance](https://daily.dev/tags/performance), [#php](https://daily.dev/tags/php)

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

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-q5kpyurse","headline":"Laravel Time Machine: A Request Lifecycle Profiler","text":"Laravel Time Machine is a request lifecycle profiler package that records timing for each stage of a Laravel request—bootstrap, middleware, routing, controller, response, and termination—down to the millisecond. It captures SQL queries with bindings and execution time, flags slow requests (over 500ms) and slow queries (over 50ms), and stores everything as flat JSON files under storage/time-machine rather than in a database. A self-contained dashboard at /time-machine visualizes each request as a Gantt-style timeline, and developers can add custom markers, measured closures, or manual spans via the TimeMachine facade. The package follows APP_DEBUG so it stays off in production by default, supports Laravel 8 through 13, and is compared against Telescope (broader app monitoring) and Debugbar (in-page toolbar) as a narrower, request-timing-focused alternative.","url":"https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-q5kpyurse","datePublished":"2026-08-06T07:19:15.567Z","dateModified":"2026-10-15T02:22:57.445Z","author":{"@type":"Person","name":"jaydeep Gadhiya","url":"https://daily.dev/jaydeepgadhiya","image":"https://media.daily.dev/image/upload/s--KiGB59cx--/f_auto/v1789371046/avatars/avatar_aZeEra5H4meZjUXRmqGOl?_a=BAMAMicg0","description":"Laravel Developer | PHP Engineer | Open Source Contributor","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":590}},"image":"https://media.daily.dev/image/upload/s--sE0DNbE8--/f_auto/v1786000756/posts/q5kpyuRSE?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":4}],"comment":[{"@type":"Comment","text":"This is a really useful approach for Laravel performance debugging. Instead of only knowing that a request is slow, Time Machine helps pinpoint exactly where the time is being spent across the request lifecycle. The flat-file storage and custom instrumentation are especially nice for quickly profiling specific bottlenecks without adding database overhead.","datePublished":"2026-08-18T04:39:02.892Z","url":"https://daily.dev/posts/q5kpyuRSE#c-35TaqiMf5","author":{"@type":"Person","name":"Champion empire","url":"https://daily.dev/championempire","image":"https://lh3.googleusercontent.com/a/ACg8ocINRzYOCX2A4bspdZ3XEfzr89sZai-1MCcJZMgBzTBRPRIUGbf8=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Must try this package!! Great Work !","datePublished":"2026-09-12T09:05:43.970Z","url":"https://daily.dev/posts/q5kpyuRSE#c-pTcgsbn8H","author":{"@type":"Person","name":"Champion empire","url":"https://daily.dev/championempire","image":"https://lh3.googleusercontent.com/a/ACg8ocINRzYOCX2A4bspdZ3XEfzr89sZai-1MCcJZMgBzTBRPRIUGbf8=s96-c"}},{"@type":"Comment","text":"This is a really useful approach for Laravel performance debugging.","datePublished":"2026-08-25T08:36:54.260Z","url":"https://daily.dev/posts/q5kpyuRSE#c-NUaZkcr7O","author":{"@type":"Person","name":"jay","url":"https://daily.dev/jay5699","image":"https://media.daily.dev/image/upload/s--_xeSiTLk--/f_auto/v1787547761/avatars/avatar_LsdoSsWkRcZTl4JfBVKam?_a=BAMAMicg0"}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/devnest","name":"Developer Nest"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Developer Nest","item":"https://daily.dev/squads/devnest"},{"@type":"ListItem","position":3,"name":"Laravel Time Machine: A Request Lifecycle Profiler"}]}
```

