/** * Show the form for creating a new resource. * * @return Response */ public function create() { $email = Input::get('email'); $input['email'] = $email; $this->validation->validate($input); $input = array_merge($input, ['senderEmail' => Auth::user()->email]); $request = $this->execute(PublishFriendRequestCommand::class, $input); return $request; }
/** * Store a newly created resource in storage. * * @return Response */ public function store() { $input = Input::only('body'); $this->statusForm->validate($input); $input = array_merge($input, ['userId' => Auth::user()->id]); $status = $this->execute(PublishStatusCommand::class, $input); $updateArr = $status->id; $updateArr = ['postId' => $updateArr, 'userId' => Auth::user()->id, 'type' => 'status']; $update = $this->execute(PublishUpdateCommand::class, $updateArr); return $status->body; }
/** * Stores a new message thread * * @return mixed */ public function storeGlobal() { $input = Input::only('message'); $this->messageForm->validate($input); $input = array_merge($input, ['user_id' => Auth::user()->id, 'global' => '1']); $message = $this->execute(PublishGlobalMessageCommand::class, $input); return $message->body; }