PHPackages                             ahkmunna/composite-unique-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. ahkmunna/composite-unique-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

ahkmunna/composite-unique-validator
===================================

Laravel 5 composite unique validator

1.0.0(9y ago)1872MITPHPPHP ~5.6|~7.0

Since Jan 31Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ahkmunna/compositeUniqueValidator)[ Packagist](https://packagist.org/packages/ahkmunna/composite-unique-validator)[ Docs](https://github.com/ahkmunna/compositeUniqueValidator)[ RSS](/packages/ahkmunna-composite-unique-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Composite Unique Validator
==========================

[](#composite-unique-validator)

A muti-column unique validation extension with exception for Laravel 5.\*

Installation
------------

[](#installation)

Install the package through [Composer](http://getcomposer.org/).

On you project directory run the `composer require` command from the Terminal:

```
composer require ahkmunna/composite-unique-validator

```

Now add the service provider to your `config/app.php` file. Add this line to the `providers` array:

```
ahkmunna\validator\CompositeUniqueValidatorServiceProvider::class

```

\##Translations Run this command to move the translation file

```
php artisan vendor:publish

```

\##Error messages Add this method in your validation request class

```
public function messages()
{
    return [
        'email.composite_unique' => trans('compositeUniqueValidator::compositeUniqueValidator.composite_unique'),
    ];
}

```

Now you're ready to start using the validator in your application.

\###Use case 1 Like any laravel validation rules:

```
$rules = array(
    'field_name' => 'composite_unique:table, unique_column_1, unique_column_2, unique_column_3',
);

```

\###Use case 2 Pass a value or Check uniqueness with a field that not in current form request:

```
$rules = array(
    'field_name' => 'composite_unique:table, unique_column_1, unique_column_2:4, unique_column_3',
);

```

unique\_column\_2 is passed with a value so the validator will ignore the form request value and compare the field with the given value, It is useful sometimes, you can give a field name that not exist in the form request but in the database table.

\###Use case 3: Check uniqueness with exception:

```
$rules = array(
    'field_name' => 'composite_unique:table, unique_column_1, unique_column_2, unique_column_3, 1',
);

```

The last parameter is a primary key of the table that row will be ignored. Useful for update operation.

\####+++ Thank You +++

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3385d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9366303?v=4)[Munna Khan](/maintainers/ahkmunna)[@ahkmunna](https://github.com/ahkmunna)

---

Top Contributors

[![ahkmunna](https://avatars.githubusercontent.com/u/9366303?v=4)](https://github.com/ahkmunna "ahkmunna (3 commits)")

---

Tags

laravelvalidator

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ahkmunna-composite-unique-validator/health.svg)

```
[![Health](https://phpackages.com/badges/ahkmunna-composite-unique-validator/health.svg)](https://phpackages.com/packages/ahkmunna-composite-unique-validator)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)[laravel-validation-rules/phone

Validate that a phone number is in the correct format

69355.5k](/packages/laravel-validation-rules-phone)[stuyam/laravel-phone-validator

A phone validator for Laravel using the free Twilio phone lookup service.

2861.3k](/packages/stuyam-laravel-phone-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
