TermRepositoryEloquent.php 1.1 KB

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