123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace App\Repositories\Validators\TCM;
- use \Prettus\Validator\Contracts\ValidatorInterface;
- use \Prettus\Validator\LaravelValidator;
- /**
- * Class PatientValidator.
- *
- * @package namespace App\Repositories\Validators\TCM;
- */
- class PatientValidator extends LaravelValidator
- {
- /**
- * Validation Rules
- *
- * @var array
- */
- protected $rules = [
- ValidatorInterface::RULE_CREATE => [
- 'name' => 'required',
- 'sex' => 'required|integer',
- 'avatar' => 'sometimes|integer',
- 'birth_date' => 'required|date',
- 'source' => 'sometimes|integer',
- 'mobile' => 'sometimes',
- 'occupation' => 'sometimes',
- 'allergy' => 'sometimes|array',
- 'past_medical' => 'sometimes|array',
- 'hospital' => 'sometimes',
- 'status' => 'required|integer',
- ],
- ValidatorInterface::RULE_UPDATE => [
- 'name' => 'required',
- 'sex' => 'required|integer',
- 'avatar' => 'sometimes|integer',
- 'birth_date' => 'required|date',
- 'source' => 'sometimes|integer',
- 'mobile' => 'sometimes',
- 'occupation' => 'sometimes',
- 'allergy' => 'sometimes|array',
- 'past_medical' => 'sometimes|array',
- 'hospital' => 'sometimes',
- 'status' => 'required|integer',
- ],
- ];
- }
|