PHPackages                             alphametric/laravel-validation-rules - 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. alphametric/laravel-validation-rules

Abandoned → [mattkingshott/axiom](/?search=mattkingshott%2Faxiom)ArchivedLibrary[Validation &amp; Sanitization](/categories/validation)

alphametric/laravel-validation-rules
====================================

A package that provides a library of reusable Laravel validation rules.

v3.2.1(5y ago)53726.4k↓100%39MITPHPPHP ^7.4|^8.0

Since Mar 20Pushed 3y ago12 watchersCompare

[ Source](https://github.com/mattkingshott/axiom)[ Packagist](https://packagist.org/packages/alphametric/laravel-validation-rules)[ Docs](https://github.com/mattkingshott/axiom)[ RSS](/packages/alphametric-laravel-validation-rules/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (36)Used By (0)

Axiom
=====

[](#axiom)

This package provides a library of reusable validation rules for your Laravel projects. Use them to augment the existing set provided by Laravel itself.

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

[](#installation)

Pull in the package using composer

```
composer require caneara/axiom
```

Upgrading
---------

[](#upgrading)

Axiom includes several breaking changes from the original package, so you'll need to follow these steps if you were using the old version:

1. Ensure that you are using PHP 7.4 or later.
2. Remove `alphametric/laravel-validation-rules` from your `composer.json` file.
3. Run `composer update` to remove the package from your `vendor` directory.
4. Install Axiom by running `composer require caneara/axiom`.
5. Replace all instances of `use Alphametric\Validation` with `use Axiom`.
6. The `EndsWith` rule has been removed as Laravel now natively supports this.
7. The `Equals` rule has been removed. Instead, you should use Laravel's native `in` rule with a single option.
8. The `DoesNotExist` rule has been renamed to `Missing`.

Usage
-----

[](#usage)

As per the Laravel [documentation](https://laravel.com/docs/master/validation#using-rule-objects), simply import the relevant validation class wherever you require it, and then include it within the rules for a particular field:

```
use Axiom\Rules\StrongPassword;

// ...

$request->validate([
    'password' => ['bail', 'required', new StrongPassword],
]);
```

**IMPORTANT**: As with all custom rules, you cannot use a pipe-delimited string. You must instead use an `array` e.g.

```
'password' => ['bail', 'required', new StrongPassword] // correct
'password' => 'bail|required|new StrongPassword'       // wrong
```

If the validation fails, the package will attempt to respond with a localized error message (see message keys below). If the key does not exist, it will fall back to a hard-coded English language version.

Available rules
---------------

[](#available-rules)

The following validation rules are currently available:

RuleMessage KeyDescriptionStrongPasswordvalidation.strong\_passwordRequires the presence of a "strong" password - see class for detailsTelephoneNumbervalidation.telephone\_numberRequires the presence of a valid telephone number - see class for detailsRecordOwnervalidation.record\_ownerRequires the authenticated user's id to match the user\_id column on a given database record e.g. owner:posts,idMonetaryFigurevalidation.monetary\_figureRequires the presence of a monetary figure e.g $72.33 - see class for detailsDisposableEmailvalidation.disposable\_emailRequires the presence of an email address which is not disposableMissingvalidation.missingRequires that the given value is not present in a given database table / column - see class for detailsDecimalvalidation.decimalRequires that the given value is a decimal with an appropriate format - see class for detailsEncodedImagevalidation.encoded\_imageRequires that the given value is a base64-encoded image of a given mime types - see class for detailsLocationCoordinatesvalidation.location\_coordinatesRequires that the given value is a comma-separated set of latitude and longitude coordinatesFileExistsvalidation.file\_existsRequires that the given value is a path to an existing file - see class for detailsMacAddressvalidation.mac\_addressRequires that the given value is a valid MAC addressISBNvalidation.isbnRequires that the given value is a valid ISBN-10 or ISBN-13 numberEvenNumbervalidation.even\_numberRequires that the given value is an even number (decimals are first converted using intval)OddNumbervalidation.odd\_numberRequires that the given value is an odd number (decimals are first converted using intval)Lowercasevalidation.lowercaseRequires that the given value is a lower case stringUppercasevalidation.uppercaseRequires that the given value is a upper case stringTitlecasevalidation.titlecaseRequires that the given value is a title case stringDomainvalidation.domainRequires that the given value be a domain e.g. google.com, [www.google.com](http://www.google.com)CitizenIdentificationvalidation.citizen\_identificationRequires that the given value be a citizen identification number of USA, UK, France, Brazil or Vietnam (see class for details)WithoutWhitespacevalidation.without\_whitespaceRequires that the given value not include any whitespace charactersMaxWordsvalidation.max\_wordsRequires that the given value cannot contain more words than specifiedHexColorvalidation.hex\_colorRequires that the given value is a valid hex color eg. #fff, #0f0f0f, #00ff0080Contributing
------------

[](#contributing)

Thank you for considering a contribution to Axiom. You are welcome to submit a PR containing improvements, however if they are substantial in nature, please also be sure to include a test or tests.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 86.3% 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

Every ~21 days

Recently: every ~82 days

Total

35

Last Release

1871d ago

Major Versions

v1.11.1 → v2.02019-06-14

v2.1.2 → v3.0.02020-04-25

PHP version history (3 changes)v1.0PHP ^7.1.3

v3.0.0PHP ^7.4

3.1.1PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3933c878b3a7403b12375106fdf8ca3681d19840b940db9b265368558e729257?d=identicon)[alphametric](/maintainers/alphametric)

---

Top Contributors

[![mattkingshott](https://avatars.githubusercontent.com/u/51963402?v=4)](https://github.com/mattkingshott "mattkingshott (63 commits)")[![guiassemany](https://avatars.githubusercontent.com/u/793994?v=4)](https://github.com/guiassemany "guiassemany (2 commits)")[![Gemui](https://avatars.githubusercontent.com/u/44297379?v=4)](https://github.com/Gemui "Gemui (1 commits)")[![innoflash](https://avatars.githubusercontent.com/u/12772919?v=4)](https://github.com/innoflash "innoflash (1 commits)")[![J2TeamNNL](https://avatars.githubusercontent.com/u/26674308?v=4)](https://github.com/J2TeamNNL "J2TeamNNL (1 commits)")[![samuelchlui](https://avatars.githubusercontent.com/u/1076091?v=4)](https://github.com/samuelchlui "samuelchlui (1 commits)")[![tkayfun](https://avatars.githubusercontent.com/u/10990971?v=4)](https://github.com/tkayfun "tkayfun (1 commits)")[![andcl](https://avatars.githubusercontent.com/u/8470427?v=4)](https://github.com/andcl "andcl (1 commits)")[![tumainimosha](https://avatars.githubusercontent.com/u/7481490?v=4)](https://github.com/tumainimosha "tumainimosha (1 commits)")[![dostrog](https://avatars.githubusercontent.com/u/948264?v=4)](https://github.com/dostrog "dostrog (1 commits)")

---

Tags

phplaravelvalidationrulesaxiom

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alphametric-laravel-validation-rules/health.svg)

```
[![Health](https://phpackages.com/badges/alphametric-laravel-validation-rules/health.svg)](https://phpackages.com/packages/alphametric-laravel-validation-rules)
```

###  Alternatives

[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1062.8k1](/packages/yorcreative-laravel-argonaut-dto)[resultsystems/validation

Inspired 'KennedyTedesco Validation' - The power of 'Respect Validation' on Laravel.

2832.4k4](/packages/resultsystems-validation)

PHPackages © 2026

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