/**
  * Get all models
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function index($builder = null)
 {
     $builder = $this->repository->getModel()->toBase();
     $builder->select('tags.*');
     $builder->addSelect(DB::raw('count(' . DB::getTablePrefix() . 'taggables.id) as uses'));
     $builder->leftJoin('taggables', function ($join) {
         $join->on('tag_id', '=', 'tags.id');
     });
     $builder->groupBy('tag');
     return parent::index($builder);
 }
 public function __construct(Repository $repository)
 {
     parent::__construct($repository);
 }
 /**
  * List resources.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function index($builder = null)
 {
     $builder = $this->repository->getModel()->with('bannerplace');
     return parent::index($builder);
 }
 /**
  * List resources.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function index($builder = null)
 {
     $builder = $this->repository->getModel()->with(['historable', 'user'])->latest();
     return parent::index($builder);
 }