total; } $new[] = $sum; } return $new; } public function addLinks(){ return view('cms.cms-addLinks'); } public function articles(){ return view('cms.articles'); } public function charts(){ return view('cms.cms-charts' , self::$data); } public function usersInfo($uid){ $user = self::$data['user'] = User::getUserInfoCms($uid); $orders = self::$data['userOrdes'] = Order::getUserOrders($user); $total = Order::getAllTotalOrders($user); self::$data['userTotalOrder'] = self::filter($total)[0]; return view('cms.cms-usersInfo' , self::$data); } static public function postUserInfo(UpdateProfile $request , $uid){ User::updateUserCms($request , $uid); $users= self::$data['users'] = User::getAllUsers(); self::$data['totalOrders'] = self::filter(Order::getAllTotalOrders($users)); return view('cms.cms-home' , self::$data); } public function getUserOrders($uid){ self::$data['orders'] = Order::getUserOrders(User::getUserInfoCms($uid) ); return view('cms.showUserOrders' , self::$data); } public function getOrderById($oid){ self::$data['order'] = Order::getOrder($oid); return view('cms.userOrder' , self::$data); } }