PolicyPropertyReoository.php 698 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Repositories;
  3. use App\Models\PolicyProperty;
  4. use Prettus\Repository\Eloquent\BaseRepository;
  5. /**
  6. * Class ArticlePropertyReoositoryEloquent.
  7. *
  8. * @package namespace App\Repositories;
  9. */
  10. class PolicyPropertyReoository extends BaseRepository
  11. {
  12. /**
  13. * Specify Model class name
  14. *
  15. * @return string
  16. */
  17. public function model()
  18. {
  19. return PolicyProperty::class;
  20. }
  21. /**
  22. * @param $where array
  23. * @return null|\Illuminate\Database\Eloquent\Model
  24. */
  25. public function getProperty($where)
  26. {
  27. return $this->model->where($where)->orderBy('category_order', 'desc')->orderBy('created_at', 'desc')->first();
  28. }
  29. }