CourseRepositoryEloquent.php 955 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Repositories\Eloquent\Course;
  3. use App\Repositories\Criteria\Course\CourseCriteria;
  4. use App\Repositories\Presenters\Course\CoursePresenter;
  5. use Prettus\Repository\Eloquent\BaseRepository;
  6. use Prettus\Repository\Criteria\RequestCriteria;
  7. use App\Contracts\Repositories\Course\CourseRepository;
  8. use App\Repositories\Models\Course\Course;
  9. /**
  10. * Class CourseRepositoryEloquent.
  11. *
  12. * @package namespace App\Repositories\Eloquent;
  13. */
  14. class CourseRepositoryEloquent extends BaseRepository implements CourseRepository
  15. {
  16. /**
  17. * Specify Model class name
  18. *
  19. * @return string
  20. */
  21. public function model()
  22. {
  23. return Course::class;
  24. }
  25. /**
  26. * Boot up the repository, pushing criteria
  27. */
  28. public function boot()
  29. {
  30. $this->pushCriteria(app(RequestCriteria::class));
  31. $this->pushCriteria(CourseCriteria::class);
  32. $this->setPresenter(CoursePresenter::class);
  33. }
  34. }