/** * To fetch all tasks * * @return \Symfony\Component\HttpFoundation\Response */ public function index() { $item = Request::get('item') ?: 5; $searchKey = Request::get('searchKey') ?: ''; $tasks = $this->taskRepo->getTaskWithPaginate($item, $searchKey); return $this->responseWithPaginate($this->taskTransformer->transformCollection($tasks->all()), $tasks); }