Laravel Time Machine is a request lifecycle profiler built by developer Jaydeep Gadhiya. It records every stage of a Laravel request—framework bootstrap, middleware, routing, controller execution, response, and the terminate step—with millisecond-level timing, answering the question of where time is spent during a request.

The package builds a Gantt-style timeline for each request and can capture every SQL query with bindings, connection name, and execution time via a toggleable collectors.queries option. Requests over 500ms and queries over 50ms are flagged as slow by default, with both thresholds configurable. Profiles are stored as plain JSON files in storage/time-machine rather than database tables, so no migrations are needed. Ignore patterns can exclude asset requests or paths like the Telescope dashboard. The profiler respects APP_DEBUG and stays disabled in production unless explicitly enabled.

Once installed, a self-contained dashboard is served at /time-machine, showing a visual timeline per request along with memory usage and query counts, with slow requests highlighted in the list.

Developers can add custom instrumentation through the TimeMachine facade: TimeMachine::mark() drops a point-in-time marker, TimeMachine::measure() times a closure, and TimeMachine::startSpan()/endSpan() allow manual span control—useful for tracking things like external API calls alongside the framework's own lifecycle phases.

By default the package retains the 100 most recent profiles, pruning older ones automatically; the limit can be adjusted via the storage.max_records config or the TIME_MACHINE_MAX_RECORDS environment variable.

Compared to Laravel Telescope and Laravel Debugbar, Time Machine occupies a middle ground: Telescope monitors a broader range of application activity (requests, jobs, mail, notifications, cache) and stores it in the database; Debugbar shows timing and query data for the current page only. Time Machine keeps a browsable history like Telescope but limits its scope to lifecycle timing and queries, stored in flat files.

The package supports Laravel 8 through 13 and installs via Composer (composer require jaydeep/laravel-time-machine) with auto-discovery for the service provider and facade; publishing the config file with php artisan vendor:publish --tag=time-machine-config is optional. Source code is available on GitHub under JaydeepGadhiya/laravel-timemachine.