Deletes a user with the given id.

@return \Closure
9153
public function delete()
    {
        $delete = function($id) {
            $user = $this->userRepository->findUserById($id);
            if (!$user) {
                throw new EntityNotFoundException($this->userRepository->getClassName(), $id);
            }

            $this->em->remove($user);
            $this->em->flush();
        };

        return $delete;
    }
1248762
public function destroy($id)
    {
        $deleted = $this->repository->delete($id);

        if (request()->wantsJson()) {
            return response()->json([
                'message' => 'Attendance deleted.',
                'deleted' => $deleted,
            ]);
        }

        return redirect()->back()->with('message', 'Attendance deleted.');
    }
928301
public function delete($id)
    {
        return $this->model->where($this->model->getKeyName(), $id)->delete();
    }
871540
public function destroy($id) {
        $key = $this->getKey($id);
        return $this->mem->remove($key);
    }
225375
public function delete($id) {
        return $this->request("DELETE", self::URL_PLANS . $id . "/", $api_key = $this->culqi->api_key);
    }
816032
public function destroy($id)
    {
        // Get the first permission that is not this one that we are trying to delete
        $default_permission = Role::findOrFail(1);

        // Build users model based on Auth config model
        $user_model = config('auth.model');
        // Update all the users that have this role. Assign them the default role.
        $user_model::where('role_id', '=', $id)
                   ->update(['role_id' => $default_permission->id]);

        // Delete the requested role.
        $role = Role::findOrFail($id);
        $role->delete();

        return redirect()->action('\Aginev\Acl\Http\Controllers\RoleController@index')
                         ->with('success', trans('acl::role.destroy.deleted'));
    }
1060175
public function deleteAction($id)
    {
        $response = $this->getResponse();
        $this->model->deleteRecord($id);
        $response->setStatusCode(Response::HTTP_NO_CONTENT);

        return $response;
    }
743033
public function destroy($id)
    {
    	$role = Role::findOrFail($id);
		$role->delete();
		
		return redirect(url("role"))->with('dp_announce', trans('deeppermission.alert.role.deleted'));
    }
1192422
private function deleteUser($id)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('user', 'delete')) {
            return $this->noPermission();
        }

        $user = User::find($id);
        // user can't be deleted if it has related data to him, like posts, categories ect
        if($user->hasRelatedData()) {
            $user->isActive = false;
            if($user->save()) {
                return true;
            }
        }

        // Delete all roles relations
        $roles = RoleRelationsModel::where('userID', $id);
        if($roles) {
            $roles->delete();
        }

        if ($user && $user->delete()) {
            return true;
        }

        return false;
    }
492296
public function destroy($id)
    {
        try {
            $result = $this->service->destroy(Auth::user(), $id);

            if ($result) {
                return redirect('teams')->with('message', 'Successfully deleted');
            }

            return redirect('teams')->with('message', 'Failed to delete');
        } catch (Exception $e) {
            return back()->withErrors($e->getMessage());
        }
    }
985773
public function deleteAction($id)
    {
        if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
            throw new InsufficientAuthenticationException('You must be authenticated to delete users');
        }

        if (intval($id) === $this->getUser()->getId()) {
            throw new InsufficientAuthenticationException('You can remove the user of your current session.');
        }

        $user = $this->getEntityManager()->find(get_class($this->getUser()), $id);

        if (!$user) {
            return $this->create404Response(sprintf('User not found with id %d', $id));
        }

        if (!$this->isGranted('DELETE', $user)) {
            throw new InsufficientAuthenticationException(sprintf('You are not authorized to delete user with id %s', $id));
        }

        $this->getEntityManager()->remove($user);
        $this->getEntityManager()->flush();

        return new Response("", 204);
    }
1313286
public function destroy($id)
    {
     	$setting = Setting::findOrfail($id);
     	$setting->delete();
        return URL::to('setting');
    }
1373605
public function remove($id)
    {
        try {
            Storage::delete($id);
            $response = $this->responseService->apiResponse('success', 'success!');
        } catch (Exception $e) {
            $response = $this->responseService->apiResponse('error', $e->getMessage());
        }

        return $response;
    }
1049129
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        Yii::$app->authManager->remove($model->item);
        AccessHelper::refeshAuthCache();
        return $this->redirect(['index']);
    }
1047130
public function deleteById($id)
    {
        $deleteResult = $this->getRequest()->request(
            'DELETE',
            $this->getRequestUrl(sprintf('inputs/%s', $id))
        );

        return $deleteResult['status'];
    }
827603
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        $model->delete();

        return $this->redirect(['index']);
    }
1332345
public function delete($id)
    {
        try {
            $this->userRepositoryInterface->delete($id);
        } catch (UsersException $e) {
            Flash::error($e->getMessage());

            return redirect()->route('users.index');
        }

        Flash::success(trans('dashboard::dashboard.flash.user.delete.success'));

        return redirect()->route('users.index');
    }