ShopRepositoryEloquent.php 849 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Repositories\Eloquent;
  3. use App\Contracts\Repositories\ShopRepository;
  4. use App\Models\Shop;
  5. use App\Repositories\Criteria\ShopCriteria;
  6. use App\Repositories\Presenters\ShopPresenter;
  7. class ShopRepositoryEloquent extends BaseRepository implements ShopRepository
  8. {
  9. /**
  10. * Boot up the repository, pushing criteria.
  11. *
  12. * @throws \Prettus\Repository\Exceptions\RepositoryException
  13. */
  14. public function boot()
  15. {
  16. $this->pushCriteria(app(ShopCriteria::class));
  17. $this->setPresenter(ShopPresenter::class);
  18. }
  19. public function model()
  20. {
  21. // TODO: Implement model() method.
  22. return Shop::class;
  23. }
  24. public function validator()
  25. {
  26. return null;
  27. }
  28. public function searchPage($limit = null)
  29. {
  30. return $this->paginate($limit);
  31. }
  32. }