PHPackages                             jaydeep/laravel-time-machine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. jaydeep/laravel-time-machine

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

jaydeep/laravel-time-machine
============================

Inspect, profile and visualize every stage of the Laravel request lifecycle — from bootstrapping to response — with detailed execution timelines and performance insights.

v1.0.0(1mo ago)65992↓12.5%MITPHPPHP ^7.4|^8.0

Since Jul 6Pushed 1mo agoCompare

[ Source](https://github.com/JaydeepGadhiya/laravel-timemachine)[ Packagist](https://packagist.org/packages/jaydeep/laravel-time-machine)[ RSS](/packages/jaydeep-laravel-time-machine/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

⏱ Laravel Time Machine — Request Lifecycle Profiler &amp; Performance Debugger for Laravel
==========================================================================================

[](#-laravel-time-machine--request-lifecycle-profiler--performance-debugger-for-laravel)

> **Profile, debug and visualize every Laravel request** — from framework boot to response — with a millisecond-accurate Gantt timeline, full SQL query profiling and a beautiful zero-config dashboard.

[![Latest Version on Packagist](https://camo.githubusercontent.com/3361276e1b843000c7809c015f96f542cd9700d3dd14c8e284f00d475e99a65d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6179646565702f6c61726176656c2d74696d652d6d616368696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jaydeep/laravel-time-machine)[![Total Downloads](https://camo.githubusercontent.com/be22296bfd7d1180edd4a5dfa5e026013c8a476acb31ad62306bf1746136e219/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6179646565702f6c61726176656c2d74696d652d6d616368696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jaydeep/laravel-time-machine)[![PHP Version](https://camo.githubusercontent.com/64c43589d7590041160fcd6a9bd7a7ef670443c2c19b710235e6279b738326b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a6179646565702f6c61726176656c2d74696d652d6d616368696e652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jaydeep/laravel-time-machine)[![Laravel 8 to 13](https://camo.githubusercontent.com/9d716afb194f73bc22209018cdbb8c3a32efa5cc9e597c4c4a587b5adae5f02a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3825323025453225383625393225323031332d4646324432302e7376673f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://laravel.com)[![License: MIT](https://camo.githubusercontent.com/4a2c8e8337966be367fca3c9b4a0e4fec3b20a56d80101b038ea9800f342351d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a6179646565702f6c61726176656c2d74696d652d6d616368696e652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

**Laravel Time Machine** is a lightweight, drop-in **Laravel performance profiler and request debugger**. It answers one simple question that every developer asks — *"Where did all the time go in this request?"* — by breaking down the complete request lifecycle into a clear, interactive timeline. Find slow queries, N+1 problems, heavy middleware and sluggish controllers in seconds, without adding a single line of setup code.

If this package saves you some debugging time, kindly **⭐ star the repository** — it really helps others discover it too!

**Request list** — all your recent requests with duration, query count, memory and status, at one glance:

[![Laravel Time Machine dashboard - request list with performance metrics](art/dashboard.png)](art/dashboard.png)

**Request detail** — a Gantt-style lifecycle timeline along with every database query:

[![Laravel Time Machine request detail - Gantt timeline and SQL query profiling](art/detail.png)](art/detail.png)

---

📑 Table of Contents
-------------------

[](#-table-of-contents)

- [Why Laravel Time Machine?](#-why-laravel-time-machine)
- [Features](#-features)
- [Installation](#-installation)
- [Usage](#-usage)
- [Instrument your own code](#instrument-your-own-code)
- [Configuration](#-configuration)
- [How it works](#-how-it-works)
- [Time Machine vs Telescope vs Debugbar](#-time-machine-vs-telescope-vs-debugbar)
- [FAQ](#-faq)
- [Requirements](#-requirements)
- [Contributing](#-contributing)
- [License](#-license)

---

🤔 Why Laravel Time Machine?
---------------------------

[](#-why-laravel-time-machine)

Debugging slow Laravel requests usually means guessing, adding random `microtime()` calls, or setting up a heavy monitoring stack. Laravel Time Machine gives you the full picture instantly:

- ✅ **Zero configuration** — install and it just works. No service registration, no asset build, no external service.
- ✅ **See the whole lifecycle** — boot, middleware, routing, controller, response and terminate, each measured to the millisecond.
- ✅ **Catch slow &amp; N+1 queries** — every SQL statement is captured with bindings, connection and duration, and slow ones are highlighted automatically.
- ✅ **Self-hosted &amp; private** — profiles are stored as plain JSON files in your own `storage/` folder. Nothing leaves your server.
- ✅ **Production-safe** — completely off unless you switch it on, so there is zero overhead when disabled.

**Perfect for:** optimizing slow endpoints, hunting N+1 queries, understanding a new codebase, teaching how Laravel handles a request, and profiling APIs during development.

✨ Features
----------

[](#-features)

- 🧭 **Full lifecycle timeline** — Bootstrap &amp; Boot → Middleware &amp; Routing → Controller &amp; Response → Terminate, each one measured upto the millisecond.
- 🗄 **Query profiling** — every single SQL statement is captured with its bindings, connection, offset on the timeline and duration (slow queries are highlighted for you).
- 📌 **Custom spans &amp; marks** — instrument your own code using just a one-line facade.
- 📊 **Visual dashboard** — a self-contained web UI that lists your recent requests with a Gantt-style timeline detail view. No asset compilation is required, it works out of the box.
- 🧠 **Performance insights** — total time, peak memory, query count/time and slow-request flagging, all in one place.
- 🪶 **Zero overhead when disabled** — it stays off in production by default, so nothing gets recorded and nothing gets rendered.

📦 Installation
--------------

[](#-installation)

Require the package via Composer:

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

The service provider and the `TimeMachine` facade get auto-discovered, so no manual registration is needed. If you want to tune the settings, publish the config file:

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

That's it. You are good to go. 🎉

🚀 Usage
-------

[](#-usage)

By default, Time Machine remains active whenever `APP_DEBUG=true`. Just browse your app as usual and then open the dashboard:

```
http://your-app.test/time-machine

```

Every non-ignored HTTP request is recorded automatically — you don't have to do anything extra. Click on any request to see its full lifecycle timeline, queries and marks.

### Instrument your own code

[](#instrument-your-own-code)

Want to profile a specific portion of your code? The same can be done easily using the facade:

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

// Drop a marker on the timeline
TimeMachine::mark('cache primed');

// Time a block of code as a span
$report = TimeMachine::measure('generate-report', function () {
    return Report::build();
});

// Or open and close it manually
TimeMachine::startSpan('external-api');
$response = Http::get('https://api.example.com');
TimeMachine::endSpan('external-api');
```

⚙️ Configuration
----------------

[](#️-configuration)

All the settings live in `config/time-machine.php` (env keys are given in brackets):

KeyDefaultPurpose`enabled` `[TIME_MACHINE_ENABLED]`follows `APP_DEBUG`Master on/off switch`dashboard.path` `[TIME_MACHINE_PATH]``time-machine`Dashboard URI prefix`dashboard.middleware``['web']`Guards the dashboard (add `auth` in production)`storage.max_records` `[TIME_MACHINE_MAX_RECORDS]``100`Profiles retained (oldest ones are pruned)`storage.path``storage/time-machine`Where the profiles are written`collectors.queries``true`Capture DB queries`ignore_paths`assets, telescope…Paths that are never profiled (wildcards allowed)`thresholds.slow_request` / `slow_query``500` / `50` msUsed for UI highlighting> **Production tip:** In case you enable it in production, lock down the dashboard with an `auth` middleware via `dashboard.middleware`. Otherwise your profiling data will be exposed to everyone, which we don't want.

🔍 How it works
--------------

[](#-how-it-works)

Internally, Time Machine anchors the whole timeline to `LARAVEL_START` and then records the phase boundaries from various framework hooks and events:

- `LARAVEL_START` → boot start
- `Application::booted()` → providers booted
- `RouteMatched` event → routing complete
- `RequestHandled` event → response ready
- A prepended global middleware's `terminate()` → request finished, profile persisted

The queries are captured via the `QueryExecuted` event. After that, everything is flattened into millisecond offsets and stored as one JSON file per request. Simple and clean.

🆚 Time Machine vs Telescope vs Debugbar
---------------------------------------

[](#-time-machine-vs-telescope-vs-debugbar)

**Laravel Time Machine**Laravel TelescopeLaravel DebugbarFull lifecycle Gantt timeline✅❌❌Zero config / no asset build✅❌✅Database (no DB tables needed)✅ (JSON files)❌ (needs migrations)✅Per-request query profiling✅✅✅Self-hosted &amp; private✅✅✅Lightweight footprint✅HeavyMediumTime Machine is intentionally focused: it does **request lifecycle profiling** extremely well, without the weight of a full monitoring suite.

❓ FAQ
-----

[](#-faq)

**Does it slow down my application?**No. When disabled it records nothing and adds virtually zero overhead. It is off in production by default.

**Do I need a database or migrations?**Not at all. Profiles are stored as plain JSON files under `storage/time-machine`, so there is nothing to migrate.

**Is it safe to run in production?**Yes, but keep it disabled unless you are actively debugging, and always protect the dashboard with an `auth` middleware if you do enable it.

**Which Laravel and PHP versions are supported?**Every Laravel version from 8 right up to the latest 13, on PHP 7.4 and 8.x. (Do note that Laravel 11+ needs PHP 8.2+ and Laravel 13 needs PHP 8.3+, as per Laravel's own requirements.)

✅ Requirements
--------------

[](#-requirements)

- PHP 7.4+ / 8.x
- Laravel 8, 9, 10, 11, 12 or 13 (the latest)

🤝 Contributing
--------------

[](#-contributing)

Contributions, bug reports and feature requests are most welcome! In case you face any issue or have some suggestion, kindly [open an issue](../../issues) or send a pull request, and I will surely revert back.

If you find this package useful, please consider **⭐ starring the repo** and sharing it with fellow Laravel developers — it goes a long way in helping the project grow.

📄 License
---------

[](#-license)

MIT © [Jaydeep Gadhiya](https://packagist.org/packages/jaydeep/laravel-time-machine)

---

**Keywords:** laravel profiler · laravel performance · laravel request lifecycle · laravel debugging · laravel query profiler · laravel timeline · laravel debug bar alternative · laravel telescope alternative · php performance profiling · slow query detection · n+1 query detection

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9e410b11aa391f9cf6562aac3a4105798ade1f2312912139c1d96bfd28fcd91?d=identicon)[JaydeepGadhiya](/maintainers/JaydeepGadhiya)

---

Top Contributors

[![JaydeepGadhiya](https://avatars.githubusercontent.com/u/86125530?v=4)](https://github.com/JaydeepGadhiya "JaydeepGadhiya (2 commits)")

---

Tags

artisandebuggingdeveloper-toolsdiagnosticslaravellaravel-packagemiddlewareperformancephprequest-lifecycletimelinelaraveldebugprofilerperformanceprofilingtimelinediagnosticsrequest-lifecycle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jaydeep-laravel-time-machine/health.svg)

```
[![Health](https://phpackages.com/badges/jaydeep-laravel-time-machine/health.svg)](https://phpackages.com/packages/jaydeep-laravel-time-machine)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
