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

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

seffeng/laravel-rules
=====================

PHP laravel extension rules

v0.1.4(3y ago)03.7k2MITPHPPHP &gt;=5.6

Since May 21Pushed 3y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (2)Versions (6)Used By (2)

Laravel Rules
-------------

[](#laravel-rules)

### 安装

[](#安装)

```
# 安装
$ composer require seffeng/laravel-rules
```

### 目录说明

[](#目录说明)

```
├─src
│  └─Rules                  验证规则
│       Password.php            密码
│       Phone.php               手机号

```

### 示例

[](#示例)

```
/**
 * TestRequest.php
 * 表单验证示例
 */
namespace App\Http\Requests;

use Seffeng\LaravelRules\Rules\Password;
use Seffeng\LaravelRules\Rules\Phone;

class TestRequest
{
    protected $fillable = ['phone', 'password'];

    public function rules()
    {
        return [
            'phone' => [
                'required',
                new Phone()
            ],
            'password' => [
                'required',
                new Password()
            ],
        ];
    }

    public function messages()
    {
        return [
            'required' => ':attribute不能为空！'
        ];
    }

    public function attributes()
    {
        return [
            'phone' => '手机号',
            'password' => '密码',
        ];
    }
}
```

### 备注

[](#备注)

无

### 更新日志

[](#更新日志)

[CHANGELOG](CHANGELOG.md)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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 ~255 days

Total

5

Last Release

1201d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30b3d8cc986a1ad37a55169b11812fea1cae31430dd8dbe1b3436dc58cc885bd?d=identicon)[seffeng](/maintainers/seffeng)

---

Top Contributors

[![seffeng](https://avatars.githubusercontent.com/u/3509779?v=4)](https://github.com/seffeng "seffeng (9 commits)")

---

Tags

phplaravellumenrulesseffeng

### Embed Badge

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

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

###  Alternatives

[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3883.5M1](/packages/axlon-laravel-postal-code-validation)[danielebarbaro/laravel-vat-eu-validator

A simple package that validates EU VAT numbers against the central ec.europa.eu database

41401.6k](/packages/danielebarbaro-laravel-vat-eu-validator)[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.

1063.3k2](/packages/yorcreative-laravel-argonaut-dto)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15104.9k4](/packages/calebdw-larastan)

PHPackages © 2026

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