1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace App\Repositories\Eloquent\Course;
- use App\Repositories\Criteria\Course\AttachCriteria;
- use App\Repositories\Criteria\RequestCriteria;
- use Prettus\Repository\Eloquent\BaseRepository;
- use App\Contracts\Repositories\Course\AttachRepository;
- use App\Repositories\Models\Course\Attach;
- use App\Repositories\Validators\Course\AttachValidator;
- /**
- * Class CourseAttachRepositoryEloquent.
- *
- * @package namespace App\Repositories\Eloquent;
- */
- class AttachRepositoryEloquent extends BaseRepository implements AttachRepository
- {
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return Attach::class;
- }
- /**
- * Specify Validator class name
- *
- * @return mixed
- */
- public function validator()
- {
- return AttachValidator::class;
- }
- /**
- * Boot up the repository, pushing criteria
- */
- public function boot()
- {
- $this->pushCriteria(app(RequestCriteria::class));
- }
- /**
- * @return mixed
- */
- public function searchAttachsByPage()
- {
- return $this->paginate(request('per_page', 15));
- }
- /**
- * @param $id
- *
- * @return mixed
- */
- public function searchAttachBy($id)
- {
- return $this->find($id);
- }
- }
|