private function setCombination() { $cat = CategoryModel::all(); if ($cat != null) { for ($c = 0; $c < count($cat); $c++) { $data[$cat[$c]->category_code] = $this->getClassCount($cat[$c]->category_code, $this->subjects[$c]); } array_walk($data, array($this, 'Compare')); return $this->combination; } else { dd("error occured"); } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { return Category::all(); }