witooh/permission

There is no license information available for the latest version (dev-master) of this package.

dev-master 2013-05-10 15:46 UTC

This package is not auto-updated.

Last update: 2024-05-06 08:05:58 UTC


README

Usage/h2> Add Service Provider ```php namespace Domains\Validators;

use Witooh\Validators\IValidator;

class LoginValidator extends IValidator {

protected $rule = array(
    'username'=>'required',
    'password' => 'required|username_password_exist'
);

protected function registerCustomValidators(){
    Validator::extend('username_password_exist', function($attribute, $value, $parameters)
    {
        $credentials = array(
            'username'=>Input::get('username'),
            'password'=>Input::get('password'),
        );

        return Auth::validate($credentials) ? true : false;
    });
}

}