Beispiel #1
0
 /**
  * @param Request $request
  * @return \BladeView|bool|\Illuminate\View\View|\Symfony\Component\HttpFoundation\Response
  */
 public function changeNameSocialItem(Request $request)
 {
     $userService = new userService();
     $name = $request->input('name', '');
     $type = $request->input('type', 0);
     $socialId = $request->input('socialId', 0);
     $result['ok'] = 0;
     try {
         $result['data'] = $userService->updateNameBusinessSocialAccount($name, $socialId, $type, $this->_user->id);
         $result['ok'] = 1;
     } catch (\Facebook\Exceptions\FacebookResponseException $e) {
         if ($request->ajax()) {
             $result['error_message'] = $e->getMessage();
             return $result;
         } else {
             return view('errors.404', ['error_message' => $e->getMessage()]);
         }
     }
     return response()->json($result);
 }