Destroy given tenant.

@param \Cortex\Tenants\Models\Tenant $tenant

@throws \Exception

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
517182
public function destroy(Tenant $tenant)
    {
        $tenant->delete();

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

        if($user->delete()) return response()->json(['status' => 'ok']);

        return response()->json(['status' => 'failed']);
    }
1072901
public function destroy($id)
    {
        // Create Response Model
        $response = new ResponseModel();

        try {
            $response->setData(collect($this->model->findOrFail($id)->delete()));
            $response->setMessage($this->getTrans('destroy', 'successful'));

        } catch (ModelNotFoundException $exception) {
            $response->setMessage($this->getTrans('destroy', 'successful'));
            $response->setStatus(false);
            $response->setError($exception->getCode());
            if (env('APP_DEBUG', false)) {
                $response->setData(collect($exception->getMessage()));
            }

        }

        return SmartResponse::response($response);
    }
212738
public function destroy(Storage $storage)
    {
        $this->storage->destroy($storage);

        return redirect()->route('admin.product.storage.index')
            ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));
    }
538189
public function destroy($id)
    {
        try {
            $this->content->destroy($id);
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.delete', ['object' => trans('soda::terminology.content')]));
        }

        return redirect()->back()->with('info', trans('soda::messages.deleted', ['object' => trans('soda::terminology.content')]));
    }
1283799
def delete_tenant(self, tenant):
        
        tenant_id = utils.get_id(tenant)
        uri = "tenants/%s" % tenant_id
        resp, resp_body = self.method_delete(uri)
        if resp.status_code == 404:
            raise exc.TenantNotFound("Tenant '%s' does not exist." % tenant)
27223
public function detachTenants($tenants = null)
    {
        $tenants = ! is_null($tenants) ? $this->prepareTenantIds($tenants) : null;

        // Sync model tenants
        $this->tenants()->detach($tenants);

        return $this;
    }
1039674
public function destroy($id)
    {
        // get permission by id
        $permission = Permission::find($id);

        if (!$permission) {
            return response()->json(null, 404);
        }

        // delete permission
        $deletePermission = $permission->delete();

        if (!$deletePermission) {
            return response()->json(null, 500); // @codeCoverageIgnore
        }

        return response()->json(null, 204);
    }
726473
public function destroy($id)
    {
        $deletedUser = $this->repository
            ->query()
            ->withTrashed()
            ->whereId($id)->first();

        $deletedUser->forceDelete();
        
        return redirect()->route('admin.user-delete-request.index');
    }
1034573
public function destroy()
    {
        $this->redis->flushDb();
        $this->close();
        $this->redis = null;

        return $this;
    }
412029
public function purge($connection = null)
    {
        $connection = $connection ?? $this->tenantName();

        $this->db->purge(
            $connection
        );

        $this->config->set(
            sprintf('database.connections.%s', $connection),
            []
        );
    }
1320093
public function destroy($id)
    {
        try {
            $wasSuccessful = $this->repository->delete($id);
            return Response::apiResponse([
                'data' => $wasSuccessful
            ]);
        } catch (\Exception $e) {
            return Response::apiResponse([
                'httpCode' => 400,
                'message' => $e->getMessage()
            ]);
        }
    }
1367164
public function destroy($id)
    {
        // get user by id
        $user = AppUser::withTrashed()->where('id', $id)->first();

        if (!$user) {
            return response()->json(null, 404);
        }

        // delete user
        $deleteUser = $user->forceDelete();

        return response()->json(null, 204);
    }
380938
public function destroy($id)
    {
        $currentUser = $this->users->getUser();

        if ($currentUser->id === (int) $id)
        {
            return Redirect::back()
                ->with('error', Lang::get('cpanel::users.delete_denied') );
        }

        try
        {
            $this->users->delete($id);
            return Redirect::route('cpanel.users.index')
                ->with('success',Lang::get('cpanel::users.delete_success'));
        }
        catch (UserNotFoundException $e)
        {
            return Redirect::route('cpanel.users.index')
                ->with('error',$e->getMessage());
        }
    }
1163261
public function destroy(int $id = 0): DestroyResponseContract
    {
        $result = $this->services['widgets']->destroy($id);

        return app()->makeWith('InetStudio\Widgets\Contracts\Http\Responses\Back\Widgets\DestroyResponseContract', [
            'result' => ($result === null) ? false : $result,
        ]);
    }
669315
public function destroy($id)
    {
        $product = Product::find($id);
        $product->delete();
        return JsonResponse::create(null, 204);
    }
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')]));
    }