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 5d 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

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

1536d 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

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[proengsoft/laravel-jsvalidation

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

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[galahad/laravel-addressing

Laravel package providing addressing functionality

70316.6k](/packages/galahad-laravel-addressing)

PHPackages © 2026

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