timadey / trailscope
Laravel request tracing and user journey observability with step logging, dashboard insights, and database or Redis storage.
Requires
- php: ^8.1
- illuminate/database: ^10.0|^11.0|^12.0
- illuminate/queue: ^10.0|^11.0|^12.0
- illuminate/redis: ^10.0|^11.0|^12.0
- illuminate/routing: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
- inertiajs/inertia-laravel: ^1.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0
- phpunit/phpunit: ^10.0|^11.0
This package is not auto-updated.
Last update: 2026-06-07 08:52:29 UTC
README
TrailScope
TrailScope is a Laravel request tracing and user journey observability package with step logging, dashboard insights, and database or Redis storage.
Install
composer require timadey/trailscope
php artisan vendor:publish --tag=trail-config
php artisan vendor:publish --tag=trail-migrations
php artisan migrate
php artisan trail:user admin@example.com --name="Admin" --role=admin
Capture Requests
Add the middleware to routes that should be traced:
Route::middleware('trail')->group(function () { Route::post('/transfer', TransferController::class); });
Exclude noisy paths in config/trail.php:
'capture' => [ 'except_paths' => ['health', 'up', 'horizon/*'], ],
Add Developer Steps
step('charging wallet', $wallet, $amount, $response);
For the clearest context keys, use named arguments or an associative array:
step('checking network', product: $product, is_active: $is_active); step('checking network', ['product' => $product, 'is_active' => $is_active]);
TrailScope also infers simple positional variable names, so step('checking network', $product, $is_active) is stored as product and is_active when possible. Complex expressions fall back to generated keys.
TrailScope automatically attaches the step to the active request trace, normalizes context, sanitizes sensitive data, resolves identity, and stores the trace through the configured driver.
Storage
The default storage driver is the host database. Redis is also available:
TRAIL_STORAGE_DRIVER=redis TRAIL_REDIS_CONNECTION=default TRAIL_REDIS_PREFIX=trail TRAIL_REDIS_TTL_DAYS=90