12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App\Repositories\Validators\Exam;
- use \Prettus\Validator\Contracts\ValidatorInterface;
- use \Prettus\Validator\LaravelValidator;
- /**
- * Class TopicValidator.
- *
- * @package namespace App\Repositories\Validators\Exam;
- */
- class TopicValidator extends LaravelValidator
- {
- /**
- * Validation Rules
- *
- * @var array
- */
- protected $rules = [
- ValidatorInterface::RULE_CREATE => [
- 'name' => 'required',
- 'type' => 'required|integer',
- 'level' => 'nullable|sometimes|integer',
- 'point' => 'nullable|sometimes|integer',
- 'body' => 'nullable',
- 'result' => 'nullable',
- 'analysis' => 'nullable',
- 'status' => 'nullable',
- ],
- ValidatorInterface::RULE_UPDATE => [
- 'name' => 'required',
- 'type' => 'required|integer',
- 'point' => 'nullable|sometimes|integer',
- 'level' => 'nullable|sometimes|integer',
- 'body' => 'nullable',
- 'result' => 'nullable',
- 'is_open' => 'nullable',
- 'analysis' => 'nullable',
- 'status' => 'nullable',
- ],
- ];
- }
|