123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace App\Repositories\Validators\Base;
- use \Prettus\Validator\Contracts\ValidatorInterface;
- use \Prettus\Validator\LaravelValidator;
- /**
- * Class RoleValidator.
- *
- * @package namespace App\Repositories\Validators\Base;
- */
- class RoleValidator extends LaravelValidator
- {
- /**
- * Validation Rules
- *
- * @var array
- */
- protected $rules = [
- ValidatorInterface::RULE_CREATE => [
- 'name' => 'required',
- 'menus' => 'sometimes|array',
- 'parent_menus' => 'sometimes|array',
- 'sort' => 'required',
- 'status' => 'required'
- ],
- ValidatorInterface::RULE_UPDATE => [
- 'name' => 'required',
- 'menus' => 'sometimes|array',
- 'parent_menus' => 'sometimes|array',
- 'sort' => 'required',
- 'status' => 'required'
- ],
- ];
- }
|