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

ActiveLibrary

bigelephant/laravel-rules
=========================

Alternative way to define rules in laravel.

5452[1 issues](https://github.com/bigelephant/laravel-rules/issues)PHP

Since Feb 5Pushed 13y ago4 watchersCompare

[ Source](https://github.com/bigelephant/laravel-rules)[ Packagist](https://packagist.org/packages/bigelephant/laravel-rules)[ RSS](/packages/bigelephant-laravel-rules/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#laravel-rules)

Alternative way to define rules in laravel.

This is just for a more PHP like syntax on rules with laravel. I personally find it easier to read at a glance. Also designed to be used in your own validators.

### Normal rules in Laravel

[](#normal-rules-in-laravel)

```
	$rules = [
		'username' 	=> 'required|alphaDash|between:3,100',
		'email'		=> 'required|email',
		'password' 	=> 'required|confirmed|min:5',

		'terms' 	=> 'accepted',
	];
```

### Under this new syntax

[](#under-this-new-syntax)

```
	$rules = [
		'username' 	=> Rule::required()->alphaDash()->between(3, 100),
		'email'		=> Rule::required()->email(),
		'password'	=> Rule::required()->confirmed()->min(5),

		'terms'		=> Rule::accepted(),
	];
```

### Installation

[](#installation)

Add the following to the "require" section of your `composer.json` file:

```
	"bigelephant/laravel-rules": "dev-master"
```

Edit the `app/config/app.php` file and...

- Add the following to your `providers` array:

```
	'BigElephant\LaravelRules\RuleServiceProvider',
```

- Add the following to your `aliases` array:

```
	'Rule' => 'BigElephant\LaravelRules\RuleFacade',
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/ac33556a611a70332996beca9c9eb795f85368b32dd49bec5c49bf5181c37e93?d=identicon)[Robbo](/maintainers/Robbo)

### Embed Badge

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

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

PHPackages © 2026

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