public function postCreate() { $user = User::getByUsername(Input::get('username')); $user = $user ? $user : User::getByEmail(Input::get('email')); if (!$user) { return Response::json(array('success' => true)); } $passwordResetNonce = $nonce = GUID::create(); $passwordReset = new PasswordReset(array('password_reset_key' => Hash::make($passwordResetNonce), 'user_uid' => $user->user_uid)); $passwordReset->save(); $passwordReset->send($nonce); return Response::json(array('success' => true)); }