Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Unique Violation Detector

Laravel Unique Violation Detector Laravel Package

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.

Deep Wiki
Context7

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.

  • Driver-aware detection for MySQL, PostgreSQL, and SQLite unique violations
  • Simple trait-based API: pass a QueryException, get a boolean
  • Works with Eloquent, the query builder, and raw statements
  • Ideal for idempotent writes, retries, and validation error mapping
  • Zero configuration, no service provider required
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package