public function edit_category_done() { $user_info = Auth::user()->toArray(); if ($user_info['user_type'] == 2) { $updated_name = Input::get('cat_name'); // OK $cat_id = Input::get('cat_id'); // OK $parent_cat = Input::get('parent_cat'); // OK $category = new Category(); $current_category = $category->edit_category_name($cat_id, $updated_name); if ($current_category) { return redirect("category/read_category"); } else { print_r('Data Not Updated'); } } $message = "you are not admin. you can't edit any category"; return view('welcome')->withMessage($message); }