1234567891011121314151617181920212223242526272829 |
- <?php
- /*
- * This file is part of the Jiannei/lumen-api-starter.
- *
- * (c) Jiannei <longjian.huang@foxmail.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
- namespace App\Repositories\Validators;
- use Prettus\Validator\Contracts\ValidatorInterface;
- use Prettus\Validator\LaravelValidator;
- class UserValidator extends LaravelValidator
- {
- protected $rules = [
- ValidatorInterface::RULE_CREATE => [
- 'name' => 'required|string|max:100',
- 'email' => 'required|email|unique:users,email',
- 'password' => 'required|min:8',
- ],
- ValidatorInterface::RULE_UPDATE => [
- 'password' => 'required|min:8',
- ],
- ];
- }
|