Exemple #1
0
 /**
  * Mendapatkan Semua Colors
  * @return mixed
  */
 public function all()
 {
     $page = \Input::get('page');
     $limit = \Input::get('limit', 1);
     $start = \Input::get('start', 1);
     if (Input::has('selected')) {
         $id = Input::get('selected');
         $record = $this->colors->findOrFail($id);
         return Response::json(['success' => true, 'error' => false, 'results' => $record->toArray()]);
     }
     $colors = $this->colors;
     $total = $colors->count();
     $colors = $colors->skip($start)->take($limit)->get()->toArray();
     $colorss = array('success' => true, 'results' => $colors, 'total' => $total);
     return Response::json($colorss)->setCallback(\Input::get('callback'));
 }