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"); } }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { Category::create($request->all()); }