DrugRepositoryEloquent.php 1.1 KB

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