serendipity_hq/component-var-dumper-f
A Laravel component wrapper for Symfony VarDumper that gives you tidy, Blade-friendly dump and dd output in your views. Inspect variables with syntax highlighting and collapsible structure instead of messy var_dump results—handy for quick debugging.
dump()/dd() write to stdout, which is useless in CLI scripts, cron jobs, queue workers, and daemons where stdout is captured or discarded by Supervisor/systemd/CI. The problem is worth solving; the package is not worth depending on. Treat this as a 20–40 line internal helper, not a vendor dependency.Log::debug() / Monolog with a JSON formatter already covers the need. In most Laravel codebases, a log channel with a readable formatter gets you 80% of the value with 0% of the maintenance risk.debug_file() helper, not a third-party micro-package.Consider it (as inspiration, or as a copy-paste source) when:
dump() output is swallowed or interleaved with machine-readable stdout.dump()/dd() are built on it. The concept composes cleanly with VarDumper::setHandler() and a custom AbstractDumper/CliDumper writing to a stream.var_export-grade output, and you want them timestamped and separated per run.Look elsewhere — and here, decisively — when:
spatie/ray, Laravel's Log::debug() with a dedicated channel, VarDumper::setHandler() configured to a stream, or Monolog with a StreamHandler pointed at storage/logs/debug.log.Net PM recommendation: Do not add this to composer.json. Read the source, reimplement the two functions internally (or wrap VarDumper::setHandler()), and treat the archived status as a hard blocker for any dependency-policy exception.
To executives (30 seconds): A developer found a tiny utility that makes debugging command-line and background jobs easier by writing debug output to a file instead of the console. The underlying idea is sound and we should use it. The package itself is abandoned — archived, two stars, no users, no maintainer. It's a few dozen lines of code, so we'll implement the pattern ourselves in about half a day. Cost: effectively zero. Risk avoided: an unmaintained dependency in our supply chain that nobody would patch if something went wrong. This is a good outcome — we get the capability without the liability.
To engineering (the substance): The pain is real: dump() and dd() write to stdout, which is captured or dropped in queue workers, cron jobs, and CI. dumpf()/ddf() redirect VarDumper output to a file, preserving the rich recursive rendering that var_export can't match. We are not taking the dependency — it's archived with zero dependents, so there's no support, no PHP-version guarantee, and no patch path. Instead we'll vendor the approach: a small internal helper (or a VarDumper::setHandler() configured against a stream) with a configurable path, per-run timestamped files, an environment gate so it can never fire in production, and a note in the debug docs. If we want more than that — levels, rotation, redaction — we should just use a dedicated Monolog channel and stop here.
How can I help you explore Laravel packages today?