1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace App\Repositories\Eloquent\Base;
- use App\Repositories\Criteria\Base\DepartmentCriteria;
- use App\Repositories\Presenters\Base\DepartmentPresenter;
- use Prettus\Repository\Eloquent\BaseRepository;
- use Prettus\Repository\Criteria\RequestCriteria;
- use App\Contracts\Repositories\Base\DepartmentRepository;
- use App\Repositories\Models\Base\Department;
- use App\Repositories\Validators\Base\DepartmentValidator;
- /**
- * Class DepartmentRepositoryEloquent.
- *
- * @package namespace App\Repositories\Eloquent;
- */
- class DepartmentRepositoryEloquent extends BaseRepository implements DepartmentRepository
- {
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return Department::class;
- }
- /**
- * Boot up the repository, pushing criteria
- */
- public function boot()
- {
- $this->pushCriteria(app(RequestCriteria::class));
- // $this->pushCriteria(app(DepartmentCriteria::class));
- // $this->setPresenter(DepartmentPresenter::class);
- }
- /**
- * @return mixed
- */
- public function searchDepartmentsByPage()
- {
- return $this->paginate(request('per_page', 15));
- }
- /**
- * @param $id
- *
- * @return mixed
- */
- public function searchDepartmentBy($id)
- {
- return $this->find($id);
- }
- }
|