PrescriptionRepositoryEloquent.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Repositories\Eloquent\TCM;
  3. use App\Repositories\Criteria\TCM\PrescriptionCriteria;
  4. use App\Repositories\Presenters\TCM\PrescriptionPresenter;
  5. use Prettus\Repository\Eloquent\BaseRepository;
  6. use Prettus\Repository\Criteria\RequestCriteria;
  7. use App\Contracts\Repositories\TCM\PrescriptionRepository;
  8. use App\Repositories\Models\TCM\Prescription;
  9. use App\Repositories\Validators\TCM\PrescriptionValidator;
  10. /**
  11. * Class PrescriptionRepositoryEloquent.
  12. *
  13. * @package namespace App\Repositories\Eloquent\TCM;
  14. */
  15. class PrescriptionRepositoryEloquent extends BaseRepository implements PrescriptionRepository
  16. {
  17. /**
  18. * Specify Model class name
  19. *
  20. * @return string
  21. */
  22. public function model()
  23. {
  24. return Prescription::class;
  25. }
  26. /**
  27. * Specify Validator class name
  28. *
  29. * @return mixed
  30. */
  31. public function validator()
  32. {
  33. return PrescriptionValidator::class;
  34. }
  35. /**
  36. * Boot up the repository, pushing criteria
  37. */
  38. public function boot()
  39. {
  40. $this->pushCriteria(app(PrescriptionCriteria::class));
  41. $this->setPresenter(PrescriptionPresenter::class);
  42. }
  43. }