PHPackages                             teepluss/harvey - 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. teepluss/harvey

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

teepluss/harvey
===============

Laravel4 separate validation

v1.0(11y ago)2190MITPHPPHP &gt;=5.3.0

Since Nov 1Pushed 11y ago1 watchersCompare

[ Source](https://github.com/teepluss/laravel4-harvey)[ Packagist](https://packagist.org/packages/teepluss/harvey)[ Docs](https://github.com/teepluss/laravel4-harvey)[ RSS](/packages/teepluss-harvey/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Harvey is separate validation for Laravel 4
-------------------------------------------

[](#harvey-is-separate-validation-for-laravel-4)

This is my internal project, not yet complete.

### Installation

[](#installation)

To get the lastest version of Theme simply require it in your `composer.json` file.

```
"teepluss/harvey": "dev-master"

```

You'll then need to run `composer install` to download it and have the autoloader updated.

Usage
-----

[](#usage)

```
class Blog extends \Teepluss\Harvey\Harvey {

    /**
     * Define rules.
     *
     * @type array
     */
    public static $rules = array(
        'description' => 'min:10|max:500',
        'onCreate'    => array(
            'title' => 'required',
            'url' => 'active_url'
        ),
        'onUpdate'    => array(
            'title' => 'required'
        )
    );

    /**
     * Custom validation messages.
     *
     * @type array
     */
    public static $messages = array(
        'title.required' => 'Please fill title before submitting.'
    );

    /**
     * Custom validation labels.

     * @type array
     */
    public static $lables = array(
        'title' => 'Title'
    );

    /**
     * Construct.

     * @param   array $attributes
     * @return void
     */
    public function __construct(array $attributes = array())
    {
        parent::__construct($attributes);

        // Custom label.
        $this->setLabelNames(array(
            'title'  => trans('labels.product'),
        ));
    }

    /**
     * Event before validate.
     *
     * @return voide
     */
    protected function beforeValidate()
    {
        $validator->sometimes('description', 'numeric', function($input)
        {
            return $input->title == 'tee';
        });
    }

}
```

### This code for creating a new content.

[](#this-code-for-creating-a-new-content)

```
$blog = new Blog;

$blog->title = 'New blog';
$blog->description = 'This is my first entry';
$blog->url = 'http://www.domain.com';

// Addition rule for another input.
$blog->addValidate(
    array('other' => Input::get('other')),
    array('other' => 'required|email'),
    array('other.required' => 'sss')
);

if ( ! $blog->save())
{
    $errors = $blog->errors();

    return Redirect::back()->withErrors($errors)->withInput();
}
```

### Validation rules for creating.

[](#validation-rules-for-creating)

```
array(3) [
    'description' => array(2) [
        string (6) "min:10"
        string (7) "max:500"
    ]
    'title' => array(1) [
        string (8) "required"
    ]
    'url' => array(1) [
        string (10) "active_url"
    ]
]
```

### This code for updating an exists content.

[](#this-code-for-updating-an-exists-content)

```
$blog = Blog::find(1);

$blog->title = 'New blog';
$blog->description = 'This is my first entry';
$blog->url = 'http://www.domain.com';

$blog->save();

if ( ! $blog->save())
{
    $errors = $blog->errors();

    return Redirect::back()->withErrors($errors)->withInput();
}
```

### Validation rules for updating.

[](#validation-rules-for-updating)

```
array(2) [
    'description' => array(2) [
        string (6) "min:10"
        string (7) "max:500"
    ]
    'title' => array(1) [
        string (8) "required"
    ]
]
```

Support or Contact
------------------

[](#support-or-contact)

If you have some problem, Contact

[![Support via PayPal](https://camo.githubusercontent.com/1c4c2a63b268ab949717893dda9628735444f61b8eb8eece283a534338b5b0e5/68747470733a2f2f7261776769746875622e636f6d2f63687269732d2d2d2f446f6e6174696f6e2d4261646765732f6d61737465722f70617970616c2e6a706567)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9GEC8J7FAG6JA)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity59

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.

###  Release Activity

Cadence

Every ~276 days

Total

2

Last Release

4301d ago

Major Versions

v0.1 → v1.02014-08-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/98f73b54567183f49c41533fc0c05cfffccdf5ed4f0351e3065d62d14779d26f?d=identicon)[teepluss](/maintainers/teepluss)

---

Tags

laravelvalidationlaravel4

### Embed Badge

![Health badge](/badges/teepluss-harvey/health.svg)

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

###  Alternatives

[schuppo/password-strength

This package provides a validator for ensuring strong passwords in Laravel 4 applications.

1432.7M1](/packages/schuppo-password-strength)[bllim/laravel-to-jquery-validation

This package makes validation rules defined in laravel work client-side by converting to jquery validation rules. It uses Jquery Validation Plugin. It also allows to use laravel validation messages so you can show same messages for both sides.

283.1k](/packages/bllim-laravel-to-jquery-validation)[stuyam/laravel-phone-validator

A phone validator for Laravel using the free Twilio phone lookup service.

2861.3k](/packages/stuyam-laravel-phone-validator)[skysplit/laravel5-intl-translation

Laravel 5 package for better translation syntax using php-intl extension

10106.2k](/packages/skysplit-laravel5-intl-translation)[pacerit/laravel-polish-validation-rules

Simple Polish Validation rules for Laravel and Lumen framework

1449.9k](/packages/pacerit-laravel-polish-validation-rules)[laravel-validation-rules/ip

Validate if an ip address is public or private.

1629.7k](/packages/laravel-validation-rules-ip)

PHPackages © 2026

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