/** * Store a newly created resource in storage. * * @return Response */ public function store() { $user = new User($this->req->all()); if (!$user->save()) { abort(500, 'Could not save user.'); } $user['token'] = $this->jwtAuth->fromUser($user); return $user; }
/** * Guarda usuarios * * @return Response */ public function store() { $reqUsr = $this->req->all(); $reqUsr['url'] = Hash::make($this->req->email); $user = new User($reqUsr); if (!$user->save()) { abort(500, 'Could not save user.'); } $user['token'] = $this->jwtAuth->fromUser($user); event(new \Camp\Handlers\Events\UserUpdatedEventHandler(User::all())); return $user; }