Delete a user.

@param  \Arcanesoft\Contracts\Auth\Models\User  $user

@return \Illuminate\Http\JsonResponse
165593
public function delete(User $user)
    {
        $this->authorize(UsersPolicy::PERMISSION_DELETE);

        try {
            ($trashed = $user->trashed()) ? $user->forceDelete() : $user->delete();

            $message = $this->transNotification(
                $trashed ? 'deleted' : 'trashed',
                ['name' => $user->full_name],
                $user->toArray()
            );

            return $this->jsonResponseSuccess(compact('message'));
        }
        catch(\Exception $e) {
            return $this->jsonResponseError(['message' => $e->getMessage()], 500);
        }
    }
1009844
public function deleteUser($userId)
    {
        try {
            return $this->innerGateway->deleteUser($userId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
465219
public function deleteUser(User $user)
    {
        $url = self::makeUserUrl($user->tenantId, $user->username);
        $this->service->prepAndSend($url, array(204), 'DELETE', null, false, 'application/json', 'application/json');
	}
483271
public function removeUsers(User ...$users)
    {
        foreach ($users as $user) {
            $this->getUsers()->removeElement($user);
        }

        return $this;
    }
1019649
public function deleteUser(User $user)
    {
        $parent = $user->getParent();
        if (!isset($this->userList[$user->getUsername()]) || $this->userList[$user->getUsername()] !== $user ||
            $parent == null
        ) {
            return false;
        }
        $this->connection->beginTransaction();
        $children = $this->getChildren($user);
        $success = true;
        foreach ($children as $child) {
            /** @var $child User */
            $success = $success && $child->setParent($parent);
        }
        $success = $success && $user->delete();

        if ($success) {
            $this->connection->commit();
            $this->setUpIterator();
        } else {
            $this->connection->rollBack();
        }
        return $success;
    }
1317854
public function deleteUser(Request $request, $user_id)
    {

        if ($request->user()->id == $user_id)
            return redirect()->back()
                ->with('warning', trans('web::seat.self_delete_warning'));

        $user = $this->getUser($user_id);
        $group = $user->group;

        // Delete the user.
        $user->delete();

        // Ensure the orphan group is cleaned up.
        if ($group->users->isEmpty()) $group->delete();

        return redirect()->back()
            ->with('success', trans('web::seat.user_deleted'));
    }
117271
public function bindUser(User $user, $binding)
    {
        return $this->bindUserID(intval($user->getUserID(), 10), $binding);
    }
253882
public function remove($user)
    {
        $this->load();
        if (!isset($this->users[$user])) {
            return false;
        }
        unset($this->users[$user]);
        return true;
    }
843622
public function deleteAction(User $user)
    {
        if ($user === $this->currentUser) {
            $this->addFlashMessage('You can not delete the currently logged in user', 'Current user can\'t be deleted', Message::SEVERITY_WARNING, [], 1412374546);
            $this->redirect('index');
        }
        $this->userService->deleteUser($user);
        $this->addFlashMessage('The user "%s" has been deleted.', 'User deleted', Message::SEVERITY_NOTICE, [htmlspecialchars($user->getName()->getFullName())], 1412374546);
        $this->redirect('index');
    }
836517
public function deleteUser($user)
    {

        $sql = sprintf("DELETE FROM {$this->dbTableNamePrefix}" . DataConnector::USER_RESULT_TABLE_NAME . ' ' .
                       'WHERE (user_pk = %d)',
                       $user->getRecordId());
        $ok = mysql_query($sql);

        if ($ok) {
            $user->initialize();
        }

        return $ok;

    }
351065
public function removeUser( core_kernel_classes_Resource $user)
    {
        $returnValue = (bool) false;

        $returnValue = $user->delete();

        return (bool) $returnValue;
    }
1023235
protected function deleteExisting(CanResetPassword $user)
    {
        return $this->makeDelete()
                    ->where('o.email = :email')
                    ->setParameter('email', $user->getEmailForPasswordReset())
                    ->getQuery()
                    ->execute();
    }
232735
public function publicDelete($user, Event $event)
    {
        if ($event->creator->id == $user->id) {
            return User::findOrFail($user->id)->hasPermission('laralum::events.delete-public');
        }

        return false;
    }
131707
public function deleteUser(User $user, string $password) : bool {
		if ($user->doesPasswordMatch($password)) {
			$stmt = $this->db->prepare(
				"DELETE FROM accounts " .
				"WHERE id=? AND username=? AND email=?;"
			);
			$stmt->bind_param("iss",
				$user->id, $user->username, $user->email);
			$stmt->execute();
			$this->db->commit();
			return true;
		} else {
			return false;
		}
	}
154554
public function delete(Customer $customer)
    {
        $endpoint = '/admin/customers/'.$customer->id.'.json';
        $response = $this->request($endpoint, 'DELETE');
        return;
    }
542173
public function deleteUser($username) {
    $users = \Drupal::entityQuery('user')
      ->condition("name", $username)
      ->execute();

    /** @var \Drupal\user\Entity\User $users */
    $users = User::loadMultiple($users);
    foreach ($users as $user) {
      $user->delete();
    }
  }
93028
public function delete(User $user, User $successor = null)
    {
        require_once ABSPATH.'wp-admin/includes/user.php';

        if ($successor instanceof User) {
            $successor = $successor->id;
        }

        return wp_delete_user($user->id, $successor);
    }