VideoRepositoryEloquent.php 1.0 KB

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