PHPackages                             anteris-dev/laravel-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. anteris-dev/laravel-rules

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

anteris-dev/laravel-rules
=========================

Strongly typed Laravel validation attributes.

01[3 issues](https://github.com/Anteris-Dev/laravel-rules/issues)PHP

Since Sep 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Anteris-Dev/laravel-rules)[ Packagist](https://packagist.org/packages/anteris-dev/laravel-rules)[ RSS](/packages/anteris-dev-laravel-rules/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Rules
=============

[](#laravel-rules)

[![Tests](https://github.com/Anteris-Dev/laravel-rules/actions/workflows/test.yaml/badge.svg)](https://github.com/Anteris-Dev/laravel-rules/actions/workflows/test.yaml)[![Style](https://github.com/Anteris-Dev/laravel-rules/actions/workflows/style.yaml/badge.svg)](https://github.com/Anteris-Dev/laravel-rules/actions/workflows/style.yaml)

This package adds classes that strongly type the [Laravel Validation Rules](https://laravel.com/docs/8.x/validation#available-validation-rules). Currently these classes cannot be used with the default Laravel Validator, though that is our long-term goal.

Using an Attribute
------------------

[](#using-an-attribute)

Any of these validation rules may be used as an attribute on a class. If the validation rule accepts parameters, they will be type hinted on the class construct.

```
class SomeClass
{
    #[Max(255)]
    public string $firstName;
}
```

Retrieving the Compiled Rules
-----------------------------

[](#retrieving-the-compiled-rules)

To retrieve the rule in Laravel format, call the `getRules()` method on any of the classes.

For example:

```
$rule = new Max(255);

// Returns: ['max:255']
$array = $rule->getRules();
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3dca3c3ac71024f7878526a0fe0a384fbf198ed711fe7e7bb34177a1dbc849f6?d=identicon)[golthem](/maintainers/golthem)

---

Top Contributors

[![aidan-casey](https://avatars.githubusercontent.com/u/6686277?v=4)](https://github.com/aidan-casey "aidan-casey (10 commits)")

### Embed Badge

![Health badge](/badges/anteris-dev-laravel-rules/health.svg)

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

PHPackages © 2026

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