Remove the team.

@param Model   $team

@return Response
502024
public function destroy(TeamRequest $request, Team $team)
    {
        try {

            $team->delete();
            return $this->response->message(trans('messages.success.deleted', ['Module' => trans('team::team.name')]))
                ->code(202)
                ->status('success')
                ->url(guard_url('team/team/0'))
                ->redirect();

        } catch (Exception $e) {

            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('team/team/' . $team->getRouteKey()))
                ->redirect();
        }

    }
535894
private function detachModel($relationship, $object, $team)
    {
        if (!Helper::isValidRelationship($relationship)) {
            throw new InvalidArgumentException;
        }

        $objectType = Str::singular($relationship);
        $relationshipQuery = $this->$relationship();

        if (Config::get('laratrust.use_teams')) {
            $relationshipQuery->wherePivot(
                    Helper::teamForeignKey(),
                    Helper::getIdFor($team, 'team')
                );
        }

        $object = Helper::getIdFor($object, $objectType);
        $relationshipQuery->detach($object);

        $this->flushCache();
        $this->fireLaratrustEvent("{$objectType}.detached", [$this, $object, $team]);

        return $this;
    }
326857
public boolean destroyTeam() throws HelloSignException {
        return HttpURLConnection.HTTP_OK == httpClient.withAuth(auth).post(BASE_URI + TEAM_DESTROY_URI).asHttpCode();
    }
276222
public static function fetchTeam($team = null)
    {
        if (is_null($team) || !Config::get('laratrust.use_teams')) {
            return null;
        }

        return static::getIdFor($team, 'team');
    }
193500
def delete_team_iteration(self, team_context, id):
        
        project = None
        team = None
        if team_context is not None:
            if team_context.project_id:
                project = team_context.project_id
            else:
                project = team_context.project
            if team_context.team_id:
                team = team_context.team_id
            else:
                team = team_context.team

        route_values = {}
        if project is not None:
            route_values['project'] = self._serialize.url('project', project, 'string')
        if team is not None:
            route_values['team'] = self._serialize.url('team', team, 'string')
        if id is not None:
            route_values['id'] = self._serialize.url('id', id, 'str')
        self._send(http_method='DELETE',
                   location_id='c9175577-28a1-4b06-9197-8636af9f64ad',
                   version='5.0',
                   route_values=route_values)
769671
public function leaveGroup(ModelInterface $group): PodiumResponse
    {
        return $this->getPodium()->member->leave($this->ensureMembership(), $group);
    }
1116622
public function destroy(Model $model)
    {
        $this->mention->where('model_type', get_class($this->model))
            ->where('model_id', $this->model->getKey())
            ->where('recipient_type', get_class($model))
            ->where('recipient_id', $model->getKey())
            ->delete();
    }
925873
public function isOwnerOfTeam( $team )
    {
        $team_id        = $this->retrieveTeamId( $team );
        return ( $this->teams()
            ->where('owner_id', $this->getKey())
            ->where('team_id', $team_id)->first()
        ) ? true : false;
    }
108849
public function show(TeamRequest $request, Team $team)
    {

        if ($team->exists) {
            $view = 'team::team.show';
        } else {
            $view = 'team::team.new';
        }

        return $this->response->title(trans('app.view') . ' ' . trans('team::team.name'))
            ->data(compact('team'))
            ->view($view, true)
            ->output();
    }
649105
public function delete($object)
    {
        try {
            $this->dm->remove($object);
            $this->dm->flush();
        } catch (\Exception $e) {
            throw new ModelManagerException('', 0, $e);
        }
    }
458275
public function update(TeamRequest $request, Team $team)
    {
        try {
            $attributes = $request->all();

            $team->update($attributes);
            return $this->response->message(trans('messages.success.updated', ['Module' => trans('team::team.name')]))
                ->code(204)
                ->status('success')
                ->url(guard_url('team/team/' . $team->getRouteKey()))
                ->redirect();
        } catch (Exception $e) {
            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('team/team/' . $team->getRouteKey()))
                ->redirect();
        }

    }
1352502
public function destroy(Request $request)
    {
        $count = 0;

        // Carregar IDs
        $ids = $this->getId($request);
        $ids = explode(',', $ids);
        foreach ($ids as $id) {
            $count += $this->deleteModel($id) ? 1 : 0;
        }

        return response()->json((object)['success' => ($count > 0), 'count' => $count]);
    }
875810
func (s *TeamsService) RemoveTeamMembership(ctx context.Context, team int64, user string) (*Response, error) {
	u := fmt.Sprintf("teams/%v/memberships/%v", team, user)
	req, err := s.client.NewRequest("DELETE", u, nil)
	if err != nil {
		return nil, err
	}

	return s.client.Do(ctx, req, nil)
}
242153
function deleteTeam (params, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      db.withTransaction([
        (job, next) => {
          const { id, organizationId } = params

          Joi.validate({ id, organizationId }, validationRules.deleteTeam, (err) => {
            if (err) return next(Boom.badRequest(err))
            next()
          })
        },
        (job, next) => {
          job.teamId = params.id
          job.organizationId = params.organizationId
          next()
        },
        loadTeamDescendants,
        deleteTeamsMembers,
        deleteTeamsPolicies,
        readDefaultPoliciesIds,
        deleteDefaultPolicies,
        removeTeams
      ], (err) => {
        if (err) return cb(err)
        cb()
      })

      return promise
    }
585786
public function down()
    {
        Schema::table(\Config::get( 'teamwork.users_table' ), function(Blueprint $table)
        {
            $table->dropColumn('current_team_id');
        });

        Schema::table(\Config::get('teamwork.team_user_table'), function (Blueprint $table) {
            $table->dropForeign(\Config::get('teamwork.team_user_table').'_user_id_foreign');
            $table->dropForeign(\Config::get('teamwork.team_user_table').'_team_id_foreign');
        });

        Schema::drop(\Config::get('teamwork.team_user_table'));
        Schema::drop(\Config::get('teamwork.team_invites_table'));
        Schema::drop(\Config::get('teamwork.teams_table'));

    }
77088
private static synchronized void removeTeam(int teamIndex) {
    TeamInfo removedTeam = liveTeams.remove(teamIndex);
    System.out.println("[-" + removedTeam + "]");
  }
436323
def remove_user(self, user_id):
        

        url = self.TEAM_USERS_ID_URL % user_id

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.delete_request()