Esempio n. 1
0
 /**
  * @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->dept->orderBy('id', 'DESC')->skip($start)->take($limit)->get()->toArray();
     $total = $this->dept->all()->count();
     $data = array('success' => true, 'results' => $_data, 'total' => $total);
     return \Response::json($data)->setCallback(\Input::get('callback'));
 }