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 today

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

Maturity28

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)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[nette/forms

📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server &amp; client side validation and mature design.

54013.2M446](/packages/nette-forms)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)

PHPackages © 2026

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