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

---
title: Laravel Time Machine: A Request Lifecycle Profiler
description: Laravel Time Machine is an open-source request lifecycle profiler for Laravel apps that records timings for each stage of a request — bootstrap, middleware,...
canonical: https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-z7fleyw7i
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 an open-source request lifecycle profiler for Laravel apps that records timings for each stage of a request — bootstrap, middleware,...
og:url: https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-z7fleyw7i
og:image: https://api.daily.dev/og/posts/z7FLEYw7i.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

**[Laravel Dev](https://daily.dev/sources/laraveldev)** · [@jaydeepgadhiya](https://daily.dev/jaydeepgadhiya) · 3 min read · 5 upvotes · 0 comments

## Summary

Laravel Time Machine is an open-source request lifecycle profiler for Laravel apps that records timings for each stage of a request — bootstrap, middleware, routing, controller, response, and termination — plus SQL query capture with bindings and execution times. It presents a Gantt-style timeline dashboard at /time-machine, flags slow requests (over 500ms) and slow queries (over 50ms) with configurable thresholds, stores profiles as flat JSON files in storage/time-machine (no database or migrations needed), and retains the last 100 profiles by default. Developers can add custom instrumentation via a TimeMachine facade (marks, measured closures, manual spans). It follows APP_DEBUG so it stays off in production by default, and supports Laravel 8 through 13. Compared to Telescope (full app monitoring, database-backed) and Debugbar (in-page toolbar), Time Machine focuses narrowly on per-request timing history stored in flat files.

## 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

- [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
- [Introducing Flare’s next big feature: performance monitoring](https://daily.dev/posts/introducing-flare-s-next-big-feature-performance-monitoring-ehqyaoale) · FREEK.DEV · 15 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-z7fleyw7i)

```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-z7fleyw7i","headline":"Laravel Time Machine: A Request Lifecycle Profiler","text":"Laravel Time Machine is an open-source request lifecycle profiler for Laravel apps that records timings for each stage of a request — bootstrap, middleware, routing, controller, response, and termination — plus SQL query capture with bindings and execution times. It presents a Gantt-style timeline dashboard at /time-machine, flags slow requests (over 500ms) and slow queries (over 50ms) with configurable thresholds, stores profiles as flat JSON files in storage/time-machine (no database or migrations needed), and retains the last 100 profiles by default. Developers can add custom instrumentation via a TimeMachine facade (marks, measured closures, manual spans). It follows APP_DEBUG so it stays off in production by default, and supports Laravel 8 through 13. Compared to Telescope (full app monitoring, database-backed) and Debugbar (in-page toolbar), Time Machine focuses narrowly on per-request timing history stored in flat files.","url":"https://daily.dev/posts/laravel-time-machine-a-request-lifecycle-profiler-z7fleyw7i","datePublished":"2026-09-16T01:28:55.793Z","dateModified":"2026-10-15T02:22:57.498Z","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":220}},"image":"https://media.daily.dev/image/upload/s--7HctKa5S--/f_auto/v1786000757/posts/VDzUHu8z2?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/laraveldev","name":"Laravel Dev"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Laravel Dev","item":"https://daily.dev/squads/laraveldev"},{"@type":"ListItem","position":3,"name":"Laravel Time Machine: A Request Lifecycle Profiler"}]}
```

