phpmyadmin/sql-parser
phpmyadmin/sql-parser is a validating SQL lexer and parser for PHP with a focus on MySQL. It lets you parse, lint, tokenize, format, and analyze SQL queries, and ships with CLI utilities and a Composer-installable library for query discovery and formatting.
->, ->>) format without spacing errors. If a "pretty-print SQL" or "copy generated query" feature is on the roadmap, this release removes known polish bugs rather than adding new surface area.getAliases() offset handling, "read property 'keyword' on null", index validation with sort order) reduce crash risk when parsing malformed or partial user-supplied SQL — relevant to any editor or validator exposed to end users.UNION SELECT, dynamic table names) and normalize queries for fingerprinting. Treat this as one signal among several — not a sole injection defense.For Executives: "This package gives us production-grade MySQL parsing, validation, and formatting without building a SQL grammar in-house — saving an estimated 6–12 months of engineering. The 6.0.1 release is a maintenance release: no breaking changes, but it fixes user-visible formatting bugs and adds PHP 8.6 compatibility, so adopting it now does not put us at risk during our next runtime upgrade. Upgrade cost is effectively zero — it's a patch-level bump."
For Engineering: *"phpmyadmin/sql-parser 6.0.1 is a low-risk dependency update:
->, ->>) and INSERT quote-style handling; if we generate/round-trip SQL, output now matches the source dialect more faithfully.For Security/Compliance:
"This supports SQL normalization and query fingerprinting — useful for anomaly detection, allow-listing, and audit trails — plus flagging of high-risk patterns (stacked statements, UNION SELECT, dynamic table names). It is a defense-in-depth signal, not a substitute for parameterized queries: any detection layer built on a parser must be validated against a corpus of known-bad queries to measure false positives and false negatives before we advertise coverage."
How can I help you explore Laravel packages today?