123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Repositories\Validators\Dianli;
- use \Prettus\Validator\Contracts\ValidatorInterface;
- use \Prettus\Validator\LaravelValidator;
- /**
- * Class TaskValidator.
- *
- * @package namespace App\Repositories\Validators\Dianli;
- */
- class TaskValidator extends LaravelValidator
- {
- /**
- * Validation Rules
- *
- * @var array
- */
- protected $rules = [
- ValidatorInterface::RULE_CREATE => [
- 'name' => 'required',
- 'type' => 'required|in:1,2',
- 'start_date' => 'required|date',
- 'end_date' => 'sometimes|nullable|date',
- 'weeks' => 'sometimes|nullable|array',
- 'paper_id' => 'sometimes|nullable|integer',
- 'assign_admin_ids' => 'required|array',
- 'status' => 'sometimes|nullable|integer',
- ],
- ValidatorInterface::RULE_UPDATE => [
- 'name' => 'required',
- 'type' => 'required|in:1,2',
- 'start_date' => 'sometimes|nullable|date',
- 'end_date' => 'sometimes|nullable|date',
- 'weeks' => 'sometimes|nullable|array',
- 'paper_id' => 'sometimes|nullable|integer',
- 'assign_admin_ids' => 'required|array',
- 'status' => 'sometimes|nullable|integer',
- ],
- ];
- }
|