mpyw/laravel-unique-violation-detector
Detects and parses unique constraint violations from database exceptions in Laravel, so you can turn duplicate-key errors into clean validation messages or custom handling across MySQL, PostgreSQL, and SQLite.
A lightweight Laravel helper for detecting unique constraint violations raised as Illuminate\Database\QueryException. Instead of brittle string matching against driver-specific error messages, it inspects SQLSTATE codes and native error numbers, so your code can reliably distinguish a duplicate-key failure from unrelated database errors—useful for retrying inserts, implementing upserts, or converting duplicates into friendly validation messages.
QueryException, get a booleanHow can I help you explore Laravel packages today?