PHPackages                             tonygeez/laravel-route-tracer - 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. tonygeez/laravel-route-tracer

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

tonygeez/laravel-route-tracer
=============================

Runtime execution tracer for Laravel routes - captures actual file dependencies and execution flow

v1.1.4(5mo ago)115MITPHPPHP ^8.0

Since Nov 15Pushed 5mo agoCompare

[ Source](https://github.com/TonyGeez/laravel-route-tracer)[ Packagist](https://packagist.org/packages/tonygeez/laravel-route-tracer)[ RSS](/packages/tonygeez-laravel-route-tracer/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Route Tracer
====================

[](#laravel-route-tracer)

**Runtime execution tracer for Laravel routes** - Captures actual file dependencies and execution flow for any Laravel route.

Why This Package?
-----------------

[](#why-this-package)

To records the **real** execution path by capturing which files PHP actually loads during a request.

### What You Get

[](#what-you-get)

- **Actual file dependencies** - Not guessing
- **Execution time** - Real performance metrics
- **Categorized files** - Controllers, Models, Policies, etc.
- **Exception tracking** - Traces even when things break
- **Zero config** - Works out of the box

Installation
------------

[](#installation)

```
composer require tonygeez/laravel-route-tracer --dev
```

The package will auto-register via Laravel's package discovery.

Publish Config (Optional)

```
php artisan vendor:publish --tag=route-tracer-config
```

Usage
-----

[](#usage)

### Method 1: Middleware (Recommended)

[](#method-1-middleware-recommended)

Wrap your routes with the trace middleware:

```
use TonyGeez\LaravelRouteTracer\Middleware\TraceRouteDependencies;

// Enable for next request
TraceRouteDependencies::enable();

Route::middleware(['trace-route'])->group(function () {
    Route::get('/api/users', [UserController::class, 'index']);
    Route::post('/api/users', [UserController::class, 'store']);
});
```

### Method 2: Artisan Commands

[](#method-2-artisan-commands)

```
# Enable tracing for next request
php artisan route:trace-enable

# Enable for specific routes
php artisan route:trace-enable api.users.index api.users.store

# Disable tracing
php artisan route:trace-disable

# View traces
php artisan route:trace-view

# View latest trace only
php artisan route:trace-view --latest

# Filter by route name
php artisan route:trace-view --route=api.users
```

### Method 3: Facade

[](#method-3-facade)

```
use TonyGeez\LaravelRouteTracer\Facades\RouteTracer;

// Enable tracing
RouteTracer::enable();

// Enable for specific routes
RouteTracer::enableForRoutes(['api.users.index', 'api.orders.show']);

// Check if enabled
if (RouteTracer::isEnabled()) {
    // ...
}

// Disable
RouteTracer::disable();
```

### Method 4: Config (Global)

[](#method-4-config-global)

Set in .env:

```
ROUTE_TRACER_ENABLED=true
```

**Example Output**

```
{
    "route": "api.users.index",
    "uri": "/api/v1/users",
    "controller": "App\\Http\\Controllers\\UserController@index",
    "method": "GET",
    "files_loaded_count": 12,
    "files_loaded": {
        "controllers": [
            "app/Http/Controllers/UserController.php"
        ],
        "models": [
            "app/Models/User.php"
        ],
        "policies": [
            "app/Policies/UserPolicy.php"
        ],
        "resources": [
            "app/Http/Resources/UserResource.php"
        ],
        "migrations": [
            "database/migrations/2024_01_01_000000_create_users_table.php"
        ]
    },
    "memory_used_mb": 2.5,
    "execution_time_ms": 45.2,
    "timestamp": "2024-01-15T10:30:45+00:00"
}

```

Configuration
-------------

[](#configuration)

All options can be configured via `config/route-tracer.php`

```
return [
    // Enable globally
    'enabled' => env('ROUTE_TRACER_ENABLED', false),

    // Output format: 'json' or 'markdown'
    'output_format' => env('ROUTE_TRACER_FORMAT', 'json'),

    // Log channel
    'log_channel' => env('ROUTE_TRACER_LOG_CHANNEL', 'stack'),

    // Exclude patterns
    'exclude_patterns' => [
        '/vendor/',
        '/bootstrap/',
        '/storage/',
    ],
];
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance69

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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

178d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/068c511886e2e5486498e59a35fa97811bfa7ac6593e985b97e2aad7313cdf3b?d=identicon)[tonygeez](/maintainers/tonygeez)

---

Top Contributors

[![TonyGeez](https://avatars.githubusercontent.com/u/141154740?v=4)](https://github.com/TonyGeez "TonyGeez (8 commits)")

---

Tags

laraveldebuggingprofilingtracingroutedependencies

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tonygeez-laravel-route-tracer/health.svg)

```
[![Health](https://phpackages.com/badges/tonygeez-laravel-route-tracer/health.svg)](https://phpackages.com/packages/tonygeez-laravel-route-tracer)
```

###  Alternatives

[barryvdh/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k124.3M624](/packages/barryvdh-laravel-debugbar)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k114.3M154](/packages/sentry-sentry-laravel)[laracraft-tech/laravel-xhprof

Easy XHProf setup to profile your laravel application!

235321.4k](/packages/laracraft-tech-laravel-xhprof)[bavix/laravel-xhprof

Quick profiling of your code for Laravel

22156.6k](/packages/bavix-laravel-xhprof)

PHPackages © 2026

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