GradeRepositoryEloquent.php 1015 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace App\Repositories\Eloquent\School;
  3. use Prettus\Repository\Eloquent\BaseRepository;
  4. use App\Contracts\Repositories\School\GradeRepository;
  5. use App\Repositories\Models\School\Grade;
  6. /**
  7. * Class GradeRepositoryEloquent.
  8. *
  9. * @package namespace App\Repositories\Eloquent\School;
  10. */
  11. class GradeRepositoryEloquent extends BaseRepository implements GradeRepository
  12. {
  13. /**
  14. * Specify Model class name
  15. *
  16. * @return string
  17. */
  18. public function model()
  19. {
  20. return Grade::class;
  21. }
  22. /**
  23. * Boot up the repository, pushing criteria
  24. */
  25. public function boot()
  26. {
  27. $this->pushCriteria(app(\App\Repositories\Criteria\RequestCriteria::class));
  28. }
  29. /**
  30. * @return mixed
  31. */
  32. public function searchGradesByPage()
  33. {
  34. return $this->paginate(request('per_page', 15));
  35. }
  36. /**
  37. * @param $id
  38. *
  39. * @return mixed
  40. */
  41. public function searchGradeBy($id)
  42. {
  43. return $this->find($id);
  44. }
  45. }