CompanyConsultantRepository.php 808 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Repositories;
  3. use App\Models\CompanyConsultant;
  4. use Prettus\Repository\Eloquent\BaseRepository;
  5. use Prettus\Repository\Criteria\RequestCriteria;
  6. /**
  7. * Class MemberRepositoryEloquent.
  8. *
  9. * @package namespace App\Repositories;
  10. */
  11. class CompanyConsultantRepository extends BaseRepository
  12. {
  13. /**
  14. * Specify Model class name
  15. *
  16. * @return string
  17. */
  18. public function model()
  19. {
  20. return CompanyConsultant::class;
  21. }
  22. /**
  23. * Boot up the repository, pushing criteria
  24. */
  25. public function boot()
  26. {
  27. $this->pushCriteria(app(RequestCriteria::class));
  28. }
  29. public function getCompanyConsultant($where)
  30. {
  31. return $this->model->with('consultants')->whereHas('consultants')->where($where)->first();
  32. }
  33. }