/** * @return mixed */ public function getAll() { if (Input::has('idselected')) { $id = Input::get('idselected'); return $this->show($id); } $page = \Input::get('page'); $limit = \Input::get('limit', 1); $start = \Input::get('start', 1); $_data = $this->departement->orderBy('id', 'DESC')->skip($start)->take($limit)->get()->toArray(); $total = $this->departement->all()->count(); $data = array('success' => true, 'results' => $_data, 'total' => $total); return \Response::json($data)->setCallback(\Input::get('callback')); }