Destroy given guardian.

@param \Cortex\Auth\Models\Guardian $guardian

@throws \Exception

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
960002
public function destroy(Guardian $guardian)
    {
        $guardian->delete();

        return intend([
            'url' => route('adminarea.guardians.index'),
            'with' => ['warning' => trans('cortex/foundation::messages.resource_deleted', ['resource' => trans('cortex/auth::common.guardian'), 'identifier' => $guardian->username])],
        ]);
    }
1266853
public function destroy($id)
    {
        $user = \App\User::findOrfail($id);

        $user->delete();

        return redirect('scaffold-users');
    }
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());
        }
    }
74074
public function destroy(OrderStatus $orderstatus)
    {
        $this->orderstatus->destroy($orderstatus);

        return redirect()->route('admin.order.orderstatus.index')
            ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('order::orderstatuses.title.orderstatuses')]));
    }
814942
public function destroy(Member $member)
    {
        $member->delete();

        return intend([
            'url' => route('managerarea.members.index'),
            'with' => ['warning' => trans('cortex/foundation::messages.resource_deleted', ['resource' => trans('cortex/auth::common.member'), 'identifier' => $member->username])],
        ]);
    }
102503
public function destroy($id)
	{
		$level = "danger";
		$message = " You are not permitted to destroy user objects";

		if ( Shinobi::can ( config('watchtower.acl.user.destroy', false) ) ) {
			$this->model::destroy($id);
			$level = "warning";
			$message = "<i class='fa fa-check-square-o fa-1x'></i> Success! User deleted.";
		}

		return redirect()->route( config('watchtower.route.as') . 'user.index')
					->with( ['flash' => ['message' => $message, 'level' =>  $level] ] );
	}
1147818
public function destroyAction($sessionId, $clientIdentifier = NULL) {
		if ($this->request->getHttpRequest()->getMethod() !== 'DELETE') {
			$this->response->setStatus(405);
			$this->response->setHeader('Allow', 'DELETE');
			return;
		}

		// TODO Move the actual logic of destroying and notification to a service
		$session = $this->sessionManager->getSession($sessionId);
		if ($session !== NULL) {
			$ssoClients = $this->singleSignOnSessionManager->getRegisteredSsoClients($session);

			$message = 'Destroyed by SSO server REST service';
			if ($clientIdentifier !== NULL) {
				$message .= ' from client "' . $clientIdentifier . '"';
			}
			$session->destroy($message);

			if ($this->ssoLogger !== NULL) {
				$this->ssoLogger->log('Session service: Destroyed session "' . $sessionId . '"' . ($clientIdentifier !== NULL ? ' from client ' . $clientIdentifier : '') , LOG_INFO);
			}

			$ssoServer = $this->ssoServerFactory->create();
			$this->ssoClientNotifier->destroySession($ssoServer, $sessionId, $ssoClients);

			$this->view->assign('value', array('success' => TRUE));
		} else {
			$this->response->setStatus(404);

			$this->view->assign('value', array('error' => 'SessionNotFound'));
		}
	}
190623
public function destroy(Admin $admin)
    {
        $admin->delete();

        return intend([
            'url' => route('adminarea.admins.index'),
            'with' => ['warning' => trans('cortex/foundation::messages.resource_deleted', ['resource' => trans('cortex/auth::common.admin'), 'identifier' => $admin->username])],
        ]);
    }
109960
public function deleteAction( $resource )
	{
		$response = $this->createAdmin( $resource )->delete( $this->getPsrRequest(), new Response() );
		return $this->setPsrResponse( $response );
	}
204605
public function destroy(Request $request, Role $role)
    {
        $this->authorize('delete', Role::class);
        $role->deletePermissions($role->permissions);
        $role->deleteUsers($role->users);

        $role->delete();

        return redirect()->route('laralum::roles.index')->with('success', __('laralum_roles::general.role_deleted', ['id' => $role->id]));
    }
565990
public function destroy(Event $event)
    {
        $this->authorize('delete', $event);
        $event->deleteUsers($event->users);
        $event->delete();

        return redirect()->route('laralum::events.index')
            ->with('success', __('laralum_events::general.event_deleted', ['id' => $event->id]));
    }
370306
public function destroy($key)
    {
        if (is_null($key)) {
            throw new \InvalidArgumentException('Empty key passed to Memcached::'.__FUNCTION__);
        }

        return $this->memcached()->delete($key);
    }
1274567
public function destroy(Customer $customer)
    {
        try {
            $name = $customer->getName();
            $customer->delete();

            flash()->info(__('Customer :name has been deleted', ['name' => $name]));
        } catch (\Exception $e) {
            flash()->error(__('Error: :msg', ['msg' => $e->getMessage()]));
        }

        return redirect(route('appshell.customer.index'));
    }
372281
public function destroy()
    {
        $request = new DestroyGroupRequest($this->groupId);
        $response = new BaseResponse();
        return $this->client->sendRequest($request, $response);
    }
485362
public function destroy()
    {
        try {
            $this->dispatch(new PerformUserLogout());
            return redirect($this->config->get('authentication.logout.redirectUri'));
        } catch (SessionHasExpired $e) {
            return redirect()->route('authentication::session.create')->withErrors([
               'authentication::login_warning' => $e->getMessage()
           ]);
        }
    }
236520
public function destroy(Tenant $tenant, Media $media)
    {
        $tenant->media()->where($media->getKeyName(), $media->getKey())->first()->delete();

        return intend([
            'url' => route('adminarea.tenants.media.index', ['tenant' => $tenant]),
            'with' => ['warning' => trans('cortex/foundation::messages.resource_deleted', ['resource' => trans('cortex/foundation::common.media'), 'identifier' => $media->getRouteKey()])],
        ]);
    }
812947
public function destroy($id)
    {
        $user = UserRepository::find($id);
        $this->checkUser($user);

        $email = $user->getLogin();

        try {
            $user->delete();
        } catch (\Exception $e) {
            return Redirect::route('users.show', ['users' => $id])
                ->with('error', 'We were unable to delete the account.');
        }

        $mail = [
            'url'     => URL::to(Config::get('credentials.home', '/')),
            'email'   => $email,
            'subject' => Config::get('app.name').' - Account Deleted Notification',
        ];

        Mail::queue('credentials::emails.admindeleted', $mail, function ($message) use ($mail) {
            $message->to($mail['email'])->subject($mail['subject']);
        });

        return Redirect::route('users.index')
            ->with('success', 'The user has been deleted successfully.');
    }