pyaesoneaung/to-raw-sql
Inspect the SQL behind your Laravel query builder and Eloquent queries. to-raw-sql converts builders into readable raw SQL strings, making debugging, logging, and optimization simple. A lightweight helper with a clean API for development.
? placeholders). The real decision isn't buy vs. build — it's whether to standardize a small internal debugging helper or take a 1-file dependency. Either way the cost is trivial; this is a low-stakes, reversible call.php artisan diagnostic command.DB::listen, Telescope, Debugbar, or an APM vendor — this package is a formatting convenience, not instrumentation.Adopt when:
Look elsewhere (or write a ~20-line helper) when:
DB::listen, Telescope, Debugbar, or an APM tool instead.To executives: A free, MIT-licensed, tiny utility that turns Laravel's internal query objects into plain SQL anyone can read. It's a developer-productivity shortcut that shortens bug triage and support cycles, with essentially no cost and no vendor lock-in. The caveat is that it's a small, single-maintainer project with no recent releases — so we'd use it as an internal convenience, wrap it behind our own code, and treat it as replaceable in an afternoon. Low value, low risk, low commitment.
To engineering: One dependency, one method call: get interpolated SQL from any Query or Eloquent builder for debugging, error context, and support tickets. Trade-off is explicit — the output is for humans, not execution; it inlines bindings so it must never be dumped into persistent logs containing PII without redaction; and the package hasn't shipped since mid-2023 with no dependents, so we pin the version and isolate it behind our own SqlFormatter-style interface. If the API surface or Laravel compatibility doesn't hold, we swap in a local helper with no caller changes.
How can I help you explore Laravel packages today?