12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace App\Repositories\Validators\Base;
- use \Prettus\Validator\Contracts\ValidatorInterface;
- use \Prettus\Validator\LaravelValidator;
- /**
- * Class MenuValidator.
- *
- * @package namespace App\Repositories\Validators\Base;
- */
- class MenuValidator extends LaravelValidator
- {
- /**
- * Validation Rules
- *
- * @var array
- */
- protected $rules = [
- ValidatorInterface::RULE_CREATE => [
- 'parent_id' => 'required|integer',
- 'name' => 'required',
- 'zh_title' => 'required',
- 'en_title' => 'required',
- 'path' => 'required',
- 'component' => 'required',
- 'redirect' => 'nullable',
- 'meta' => 'required',
- 'sort' => 'required|integer',
- 'status' => 'required|integer',
- ],
- ValidatorInterface::RULE_UPDATE => [
- 'parent_id' => 'required|integer',
- 'name' => 'required',
- 'zh_title' => 'required',
- 'en_title' => 'required',
- 'path' => 'required',
- 'component' => 'required',
- 'redirect' => 'nullable',
- 'meta' => 'required',
- 'sort' => 'required|integer',
- 'status' => 'required|integer',
- ],
- ];
- }
|