PHPackages                             robclancy/validation - 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. robclancy/validation

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

robclancy/validation
====================

A validations package built for PHP 5.4 and easy validation for framworks.

022PHP

Since Mar 29Pushed 13y ago1 watchersCompare

[ Source](https://github.com/robclancy/validation)[ Packagist](https://packagist.org/packages/robclancy/validation)[ RSS](/packages/robclancy-validation/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

validation
==========

[](#validation)

This isn't ready for use.

The following is a dump to explain things for feedback.

First we have an alias, `Validatable` will alias `RobClancy\Validation\Illuminate`.

To use this for model validation you would do...

```
// Note most of this would be in a base class
class Post extends Eloquent {

	// We import the validator methods
	use Validatable;

	// Define the input and rules to validate, basic post validation
	public function defineInput()
	{
		$this->input('user_id')->required()->integer();
		$this->input('post')->required();
	}

	// Then we have our save method
	public function save()
	{
		if ( ! $this->validate($this->attributes))
		{
			return false;
			// User can now call $this->getErrors() for a list of errors
		}

		// Doing this means we can push Input::all() into the model and the validator will filter out what we need
		$this->attributes = $this->getValidatedInput();

		return parent::save();
	}
}
```

So the above in a controller would be...

```
class PostController extends Controller {

	...

	public function postIndex()
	{
		$post = new Post(Input::all());
		if ( ! $post->save())
		{
			return Redirect::back()->withErrors($post->getErrors(), $post->getInput());
		}

		return Redirect::to('success/page');
	}
}```

Then I had a use case for logging in, didn't want to validate input before sending to authentication on a model so can do this instead...
```php
class LoginController extends Controller {

	use Validatable;

	// getLogin method etc here

	// Define the input to validate against
	public function defineInput()
	{
		$this->input('email')->required()->email();
		$this->input('password')->required();
	}

	// And once again use the new methods here
	public function postIndex()
	{
		if ( ! $this->validate())
		{
			return Redirect::back()->withErrors($this->getErrors());
		}

		// run authentication
	}
}
```

In the controller example you can also skip the defineInput method and do this instead...

```
class LoginController extends Controller {

	use Validatable;

	...

	public function postIndex()
	{
		$validate = $this->validate(function($add)
		{
			$add->input('email')->required()->email();
			$add->input('password')->required();
		});

		if ( ! $validate)
		{
			return Redirect::back()->withErrors($this->getErrors());
		}

		// authenticate
	}
}
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

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/robclancy-validation/health.svg)

```
[![Health](https://phpackages.com/badges/robclancy-validation/health.svg)](https://phpackages.com/packages/robclancy-validation)
```

###  Alternatives

[chaoswey/taiwan-id-validator

台灣身分證、統一編號驗證

319.9k](/packages/chaoswey-taiwan-id-validator)

PHPackages © 2026

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