123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace App\Repositories\Eloquent\School;
- use App\Repositories\Criteria\School\StudentCriteria;
- use App\Repositories\Presenters\School\StudentPresenter;
- use Prettus\Repository\Eloquent\BaseRepository;
- use Prettus\Repository\Criteria\RequestCriteria;
- use App\Contracts\Repositories\School\StudentRepository;
- use App\Repositories\Models\School\Student;
- use App\Repositories\Validators\School\StudentValidator;
- /**
- * Class StudentRepositoryEloquent.
- *
- * @package namespace App\Repositories\Eloquent\School;
- */
- class StudentRepositoryEloquent extends BaseRepository implements StudentRepository
- {
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return Student::class;
- }
- /**
- * Specify Validator class name
- *
- * @return mixed
- */
- public function validator()
- {
- return StudentValidator::class;
- }
- /**
- * Boot up the repository, pushing criteria
- */
- public function boot()
- {
- $this->pushCriteria(app(\App\Repositories\Criteria\RequestCriteria::class));
- }
- /**
- * @return mixed
- */
- public function searchStudentsByPage()
- {
- return $this->paginate(request('per_page', 15));
- }
- /**
- * @param $id
- *
- * @return mixed
- */
- public function searchStudentBy($id)
- {
- return $this->find($id);
- }
- }
|