mpyw/unique-violation-detector
Detects and normalizes unique constraint violation errors across MySQL, PostgreSQL, and SQLite. Inspects PDO exceptions and SQLSTATE codes so your PHP/Laravel app can reliably catch duplicate-key errors and handle retries or upserts without brittle driver-specific checks.
mpyw/unique-violation-detector is a tiny PHP utility that tells you whether a database exception was caused by a unique constraint violation. Instead of scattering driver-specific error-code checks throughout your code, you hand it a caught exception and get a simple boolean answer.
It normalizes the quirks of MySQL, PostgreSQL, and SQLite error responses, so the same logic works across drivers and in both raw PDO and Laravel applications.
How can I help you explore Laravel packages today?