/** * @param Request $request * @return mixed */ public function index(Request $request) { if ($request->query->get('paginate') === 'false') { return $this->repository->all(); } return $this->repository->paginate($request->query->get('limit')); }
public function all($columns = array('*')) { $collection = parent::all($columns); if ($this->with_relation_count) { $collection = $this->setCountedFields($collection); } return $collection; }