1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace App\Repositories\Eloquent\Course;
- use App\Repositories\Criteria\Course\ChapterCriteria;
- use App\Repositories\Criteria\RequestCriteria;
- use App\Repositories\Presenters\Course\ChapterPresenter;
- use Prettus\Repository\Eloquent\BaseRepository;
- use App\Contracts\Repositories\Course\ChapterRepository;
- use App\Repositories\Models\Course\Chapter;
- use App\Repositories\Validators\Course\ChapterValidator;
- /**
- * Class CourseChapterRepositoryEloquent.
- *
- * @package namespace App\Repositories\Eloquent;
- */
- class ChapterRepositoryEloquent extends BaseRepository implements ChapterRepository
- {
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return Chapter::class;
- }
- /**
- * Specify Validator class name
- *
- * @return mixed
- */
- public function validator()
- {
- return ChapterValidator::class;
- }
- /**
- * Boot up the repository, pushing criteria
- */
- public function boot()
- {
- $this->pushCriteria(app(RequestCriteria::class));
- }
- /**
- * @return mixed
- */
- public function searchChaptersByPage()
- {
- return $this->paginate(request('per_page', 15));
- }
- /**
- * @param $id
- *
- * @return mixed
- */
- public function searchChapterBy($id)
- {
- return $this->find($id);
- }
- }
|