Download the PHP package mpyw/laravel-unique-violation-detector without Composer
On this page you can find all versions of the php package mpyw/laravel-unique-violation-detector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mpyw/laravel-unique-violation-detector
More information about mpyw/laravel-unique-violation-detector
Files in mpyw/laravel-unique-violation-detector
Package laravel-unique-violation-detector
Short Description Detect primary/unique key or constraint violation errors from PDOException.
License MIT
Informations about the package laravel-unique-violation-detector
Laravel Unique Violation Detector
[!CAUTION] ABANDONED: The functionalities of this library have been integrated into the Laravel core due to changes in Laravel v10.20.0. From now on, the
Illuminate\Database\UniqueConstraintViolationException
exception class will be thrown when there is a unique constraint violation, so there is no need to use this library for judgment. Simply checking withcatch
orinstanceof
should be sufficient. Although the internal judgment logic is strictly different in some parts, it should be replaceable without any problems in most cases.
Detect primary/unique key or constraint violation errors from PDOException
.
Requirements
Package | Version |
---|---|
PHP | ^8.0 |
Laravel | ^9.0 || ^10.0 |
mpyw/unique-violation-detector | ^1.0 |
Supported Connections
Database | Connection Class |
---|---|
MySQL | Illuminate\Database\MySqlConnection |
PostgreSQL | Illuminate\Database\PostgresConnection |
SQLite | Illuminate\Database\SQLiteConnection |
SQLServer | Illuminate\Database\SqlServerConnection |
You can also add custom resolvers by one of the following:
Mpyw\LaravelUniqueViolationDetector\Facades\Unique::resolverFor()
Mpyw\LaravelUniqueViolationDetector\DetectorDiscoverer::resolverFor()
Installing
Usage
You can detect unique violations in various ways.
All versions of laravel-unique-violation-detector with dependencies
ext-pdo Version *
illuminate/support Version ^9.0 || ^10.0 || ^11.0
illuminate/database Version ^9.0 || ^10.0 || ^11.0
illuminate/contracts Version ^9.0 || ^10.0 || ^11.0
mpyw/unique-violation-detector Version ^1.0