PHPackages                             risan/lara-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. risan/lara-rules

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

risan/lara-rules
================

Laravel custom validation rules.

v1.0.2(4y ago)050MITPHPPHP ^7.3|^8.0

Since Dec 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/risan/lara-rules)[ Packagist](https://packagist.org/packages/risan/lara-rules)[ Docs](https://github.com/risan/lara-rules)[ RSS](/packages/risan-lara-rules/feed)WikiDiscussions main Synced 3w ago

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

Lara Rules
==========

[](#lara-rules)

Laravel custom validation rules.

[![Latest Stable Version](https://camo.githubusercontent.com/d920f86ddcd2f70496724d8b9d28a6009134c4f82c10ea5f8c901c8260b0a16d/68747470733a2f2f706f7365722e707567782e6f72672f726973616e2f6c6172612d72756c65732f76)](https://packagist.org/packages/risan/lara-rules)[![License](https://camo.githubusercontent.com/6616241f01ce7cf5ca5a3a679feca33d3d88b236d13a2a106460161e30b9c1c9/68747470733a2f2f706f7365722e707567782e6f72672f726973616e2f6c6172612d72756c65732f6c6963656e7365)](https://packagist.org/packages/risan/lara-rules)

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

[](#installation)

This package requires you to use Laravel version 8. Install this package through Composer.

```
$ composer require risan/lara-rules
```

Usage
-----

[](#usage)

```
use Risan\LaraRules\USPhoneWithDash;

$request->validate([
    'phone' => ['required', 'string', new USPhoneWithDash], // Valid: 123-456-7890
    'state' => ['required', 'string', new USStateCode], // Valid: CA, TX
    'zip_code' => ['required', 'string', new USZipCode], // Valid: 90120 or 20521-9000
]);
```

- `USPhoneWithDash`: 10 digits of US phone number with dash.
- `USStateCode`: 2 characters of US state code.
- `USZipCode`: 5 or 9 digits of US zip code.

License
-------

[](#license)

[MIT](https://github.com/risan/helpers/blob/master/LICENSE) © [Risan Bagja Pradana](https://risanb.com)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~214 days

Total

3

Last Release

1583d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3825242?v=4)[Risan Bagja Pradana](/maintainers/risan)[@risan](https://github.com/risan)

---

Top Contributors

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

---

Tags

laravelvalidation

### Embed Badge

![Health badge](/badges/risan-lara-rules/health.svg)

```
[![Health](https://phpackages.com/badges/risan-lara-rules/health.svg)](https://phpackages.com/packages/risan-lara-rules)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M299](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.5k](/packages/illuminate-database)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M186](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k253.1k79](/packages/moonshine-moonshine)

PHPackages © 2026

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