-
Notifications
You must be signed in to change notification settings - Fork 1
/
BaseUserValidator.php
47 lines (44 loc) · 1.41 KB
/
BaseUserValidator.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php namespace Gzero\Validator;
/**
* This file is part of the GZERO CMS package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Class BaseUserValidator
*
* @package Gzero\Validator
* @author Adrian Skierniewski <[email protected]>
* @copyright Copyright (c) 2015, Adrian Skierniewski
*/
class BaseUserValidator extends AbstractValidator {
/**
* @var array
*/
protected $rules = [
'login' => [
'email' => 'required|email',
'password' => 'required'
],
'register' => [
'email' => 'required|email|unique:users',
'nick' => 'required|min:3|unique:users',
'password' => 'required|min:6',
'first_name' => 'nullable|min:2|regex:/^([^0-9]*)$/', // without numbers
'last_name' => 'nullable|min:2|regex:/^([^0-9]*)$/' // without numbers
],
'remind' => [
'email' => 'required|email',
],
'reset' => [
'email' => 'required|email',
'password' => 'required|min:6|same:password_confirmation',
'password_confirmation' => 'required|min:6|same:password',
'token' => '',
]
];
/**
* @var array
*/
protected $filters = [];
}