12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace App\Repositories\Validators\Exam;
- use \Prettus\Validator\Contracts\ValidatorInterface;
- use \Prettus\Validator\LaravelValidator;
- /**
- * Class PaperValidator.
- *
- * @package namespace App\Repositories\Validators\Exam;
- */
- class PaperValidator extends LaravelValidator
- {
- /**
- * Validation Rules
- *
- * @var array
- */
- protected $rules = [
- ValidatorInterface::RULE_CREATE => [
- 'title' => 'required',
- 'body' => 'nullable',
- 'category_id' => 'nullable|integer',
- 'mark' => 'nullable',
- 'course_id' => 'nullable|integer',
- 'video_id' => 'nullable|integer',
- 'time' => 'nullable|integer',
- 'published_at' => 'nullable',
- 'status' => 'nullable|integer',
- 'topics' => 'sometimes|nullable',
- ],
- ValidatorInterface::RULE_UPDATE => [
- 'title' => 'required',
- 'topics' => 'sometimes|nullable',
- 'category_id' => 'nullable|integer',
- 'body' => 'nullable',
- 'mark' => 'nullable',
- 'time' => 'nullable|integer',
- 'course_id' => 'nullable|integer',
- 'video_id' => 'nullable|integer',
- 'published_at' => 'nullable',
- 'status' => 'nullable|integer',
- ],
- ];
- }
|