nilportugues/sql-query-formatter
Lightweight PHP SQL formatter that turns messy, computer-generated queries into clean, human-readable plain text. Preserves data-binding placeholders like :variable and ? while reformatting, making SQL easier to read and debug without adding colors or markup.
shiny/sql-formatter, which supports PHP 8+ and modern SQL).For Executives:
"This update lets us use this SQL formatter in legacy PHP 5.5+ apps without blocking upgrades elsewhere. For teams maintaining older Laravel versions (e.g., 5.2–5.5), it’s a free, self-hosted way to improve debugging—cutting incident resolution time by formatting unreadable SQL logs. The tradeoff? We’re stuck with a 2015-era tool until we migrate off PHP 5.5. Recommend adopting it only for legacy systems and planning a replacement (e.g., shiny/sql-formatter) for new projects."
For Engineering: *"PHP 5.5+ support confirmed—this works for:
shiny/sql-formatter instead. For now, this is a stopgap for old stacks—not a long-term solution."*For Developers: *"Need to format SQL in PHP 5.5–7.4? This still works:
$formatter = new \SQLFormatter\SQLFormatter;
$prettySql = $formatter->format('SELECT * FROM users WHERE id IN (1,2,3)');
// Outputs formatted SQL
But:
shiny/sql-formatter instead.composer require sql-formatter/sql-formatter:^1.2 (but plan to migrate)."Key Change: Added PHP version constraints and urgency to migrate due to PHP 5.5 deprecation. Highlighted as a legacy-only tool with a clear upgrade path.
How can I help you explore Laravel packages today?