Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Tracer

Laravel Tracer Laravel Package

protonemedia/laravel-tracer

Laravel Tracer wraps every rendered Blade view in HTML comments showing that view's path, so you can inspect the page source in your browser and instantly find the template responsible for any markup. A small, handy debugging aid for apps with deeply nested views.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Laravel Tracer
What does protonemedia/laravel-tracer actually do?
It hooks Eloquent model events and records the origin of each change — the calling file, line and stack, plus a payload snapshot — into a database table, usually after you apply its trait to selected models. It is a debugging aid for tracing stray writes, not a full audit-log product: it has no actor identity, retention policy, immutability or tamper resistance. Keep it to a small, explicitly enumerated set of models in development or staging.
Is laravel-tracer compatible with Laravel 10 or Laravel 11?
The last release was 2022-08-01 and the upstream repository is archived, so its illuminate/* and PHP constraints almost certainly predate Laravel 10/11 and PHP 8.2/8.3. A modern application should expect Composer constraint conflicts and should run an install against its actual composer.lock before committing. On Laravel 10/11, treat it as an unverified dependency and budget a compatibility spike or a fork.
Is protonemedia/laravel-tracer still maintained?
No — the upstream repository is archived, with a last release in August 2022, 4 stars and 0 dependents. That means no security response, no bug fixes and no compatibility patches. Every future Laravel or PHP upgrade becomes your team's problem.
Can laravel-tracer be used as an audit log in production?
No. It captures model attribute snapshots into a queryable table but has no notion of actor identity, retention, immutability or tamper resistance, and it can pull PII into an ungoverned store. Use it only as a development or staging diagnostic. For production-facing audit requirements, choose a maintained audit package or an in-house event log.
How do I install and configure protonemedia/laravel-tracer?
Installation is mechanically simple: Composer require the package, publish its config and migration, apply the trait to the models you want to trace, and optionally register its middleware or context provider. The migration adds a traces-style table that you then own permanently, including its indexes and data lifecycle. The real friction is metadata: pin the version and verify the Composer constraints on your target Laravel version.
Does laravel-tracer work in queue workers, console commands and scheduled jobs?
The package captures a debug_backtrace() at the point of the model event, so it can record a calling file and line even outside HTTP requests. However, anything that depends on request middleware or HTTP context will not be available in queue workers, console commands and scheduled jobs. Test each context explicitly before relying on it.
Does laravel-tracer break model saves if the trace insert fails?
That is the single most important thing to verify: tracing runs inside model event listeners, so if the trace insert throws — from DB contention, oversized payloads, unserializable attributes or binary columns — the exception may propagate into the business write. Check whether the package is fail-open (swallows errors) or fail-closed (breaks the model write). If it is fail-closed, wrap or replace it before any production consideration.
How do I redact or exclude sensitive attributes in laravel-tracer?
The package records a payload snapshot of model attributes, which can capture PII or secrets into an ungoverned table. Check the published config for attribute filtering, and if redaction is not supported, fork the package or exclude sensitive models entirely. Never apply the trait to models containing credentials, tokens or personal data without a redaction strategy.
What is the performance overhead of laravel-tracer?
Each tracked event writes a row containing the stack and a payload snapshot, which may be stored as a large text column. Measure per-event row size and write amplification on your highest-traffic tracked model before enabling it broadly. Sampling, limiting the tracked model set and a retention job are the usual controls.
What are alternatives to protonemedia/laravel-tracer?
Laravel Telescope and Pulse cover most development diagnostics, spatie/laravel-activitylog or an in-house event log covers production-facing auditing, and a hand-rolled observer plus debug_backtrace() reproduces the core capability in about one to two engineer-days. Reimplementing is often preferable because you own the schema, redaction, sampling and fail-open behavior from day one. An internal fork is the fallback if the original implementation has nuance you would rather not reproduce.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console