ScheduleRepositoryEloquent.php 1.2 KB

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