123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace App\Repositories;
- use App\Models\CompanyConsultant;
- use Prettus\Repository\Eloquent\BaseRepository;
- use Prettus\Repository\Criteria\RequestCriteria;
- /**
- * Class MemberRepositoryEloquent.
- *
- * @package namespace App\Repositories;
- */
- class CompanyConsultantRepository extends BaseRepository
- {
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return CompanyConsultant::class;
- }
-
- /**
- * Boot up the repository, pushing criteria
- */
- public function boot()
- {
- $this->pushCriteria(app(RequestCriteria::class));
- }
-
- public function getCompanyConsultant($where)
- {
- return $this->model->with('consultants')->whereHas('consultants')->where($where)->first();
- }
-
- }
|