Пример #1
0
 /**
  * Execute the command.
  *
  * @return void
  */
 public function handle()
 {
     $socialService = new socialService();
     $payload = base64_decode($this->_payload);
     $data = json_decode($payload);
     \Log::info('__QUEUE__ PROCESSING post to social with social post id: ' . $data->socialPostId);
     $socialService->postToSocial($data->socialPostId, $data->userId, $data->social, $data->images, $data->desc);
     \Log::info('__QUEUE__ SUCCESS post to social with social post id: ' . $data->socialPostId);
 }
Пример #2
0
 public function postToSocial(Request $request)
 {
     $socialService = new socialService();
     $socials = $request->input('socials', 0);
     $desc = $request->input('desc', '');
     $products = $request->input('products', 0);
     try {
         $return['data'] = $socialService->superPostToSocial($this->_user->id, $socials, $products, $desc);
         $return['ok'] = 1;
     } catch (\Exception $e) {
         if ($request->ajax()) {
             $result['error'] = $e->getMessage();
             return $result;
         } else {
             return view('errors.404', ['error_message' => $e->getMessage()]);
         }
     }
     return response()->json($return);
 }