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