Delete a project.

@param string $slug The slug for the resource

@return ResponseInterface
439774
public function deleteProject(string $slug): ResponseInterface
    {
        return $this->client->sendRequest($this->createRequest('DELETE', $this->createUri("/api/2/project/$slug")));
    }
755857
public function deleteUserBySlug($slug)
    {
        $userToDelete = $this->getUserBySlug($slug);
        if (empty($userToDelete)) {
            throw new \Exception('Trying to delete a user that doesn\'t exist.');
        }
        $users = $this->getUsers();
        foreach ($users as $key => $user) {
            if ($user->slug == $userToDelete->slug) {
                unset($users[$key]);
                $this->repository->users = array_values($users);
            }
        }
        $this->save();
    }
233641
public function getRedirectBySlug($slug)
    {
        $redirects = $this->repository->redirects;
        foreach ($redirects as $redirect) {
            if ($redirect->slug == $slug) {
                return $redirect;
            }
        }

        return null;
    }
1309890
public function actionDelete($slug, $id)
    {
        $current_model = $this->module->getModel($slug);

        if(($current_model = $current_model::findOne($id))){
            $current_model->delete();
        } else {
            $this->error =  Yii::t('easyii', 'Not found');
        }
        return $this->formatResponse(Yii::t('gr', 'Post deleted'));
    }
1086765
public function destroy(Request $request, $id)
    {
        $this->slug = $this->getSlug($request);
        if (!$this->can('delete-' . Str::plural($this->slug), auth()->user()->id)) {
            abort(404);
        }
        Laramin::model($this->type->name)->find($id)->delete();

        Session::flash($this->flashname, $this->SessionMessage("Your {$this->slug} Has Been Succesfully Destroyed", 'success'));

        return redirect()->route("laramin.{$this->slug}.index");
    }
695807
public function deleteSitemapItemBySlug($slug)
    {
        $sitemap = $this->repository->sitemap;
        foreach ($sitemap as $key => $sitemapItem) {
            if ($sitemapItem->slug == $slug) {
                unset($sitemap[$key]);
            }
        }
        $sitemap = array_values($sitemap);
        $this->repository->sitemap = $sitemap;
        $this->save();
    }
1375015
public function destroy($id)
    {
        if ( $this->permissions->delete($id) )
        {
            return Redirect::route('cpanel.permissions.index')
                ->with('success', Lang::get('cpanel::permissions.delete_success'));
        }
        else
        {
            return Redirect::route('cpanel.permissions.index')
                ->with('error', Lang::get('cpanel::permissions.model_not_found'));
        }
    }
404391
public function deleteAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $em->remove($this->getImage($id));
        $em->flush();

        return new Response();
    }
897774
public function updateProject(string $slug, array $options): ResponseInterface
    {
        $data = $this->buildProjectRequest($options);

        // Make sure we actually have data to send
        if (empty($data)) {
            throw new \RuntimeException('There is no data to send to Transifex.');
        }

        $request = $this->createRequest('PUT', $this->createUri("/api/2/project/$slug/"));
        $request = $request->withBody($this->streamFactory->createStream(\json_encode($data)));
        $request = $request->withHeader('Content-Type', 'application/json');

        return $this->client->sendRequest($request);
    }
605341
public function deleteBrickBySlug($slug)
    {
        $bricks = $this->repository->bricks;
        foreach ($bricks as $key => $brickObject) {
            if ($brickObject->slug == $slug) {
                unset($bricks[$key]);
            }
        }

        $bricks = array_values($bricks);
        $this->repository->bricks = $bricks;
        $this->save();
    }
598106
public function removeAction($slug)
    {
        if (array_key_exists($slug, $this->actions)) {
            unset($this->actions[$slug]);

            return true;
        } else {
            return false;
        }
    }
962609
public static function removeDateFromSlug($slug)
    {
        $slug = trim($slug, '/');
        while(preg_match('/^\d{4}\/\d{2}\/\d{2}\/?(\S+)?/', $slug, $m))
            $slug = trim(isset($m[1])?$m[1]:'', '/');
        return $slug;
    }
1226902
public function deleteDocumentTypeBySlug($slug)
    {
        $documentTypes = $this->repository->documentTypes;
        foreach ($documentTypes as $key => $documentTypeObject) {
            if ($documentTypeObject->slug == $slug) {
                unset($documentTypes[$key]);
            }
        }
        $documentTypes = array_values($documentTypes);
        $this->repository->documentTypes = $documentTypes;
        $this->save();
    }
568055
public function getBySlug($slug)
    {
        if (! isset($this->entitiesBySlug[$slug])) {
            throw new DomainErrorException('Unable to find entity for slug '.$slug.'!');
        }

        return $this->entitiesBySlug[$slug];
    }
279340
protected function rollback($slug)
    {
        if (! $this->packages->exists($slug)) {
            return $this->error('Package does not exist.');
        }

        $this->requireMigrations($slug);

        //
        $this->migrator->setConnection($this->input->getOption('database'));

        $pretend = $this->input->getOption('pretend');

        $this->migrator->rollback($pretend, $slug);

        //
        foreach ($this->migrator->getNotes() as $note) {
            if (! $this->option('quiet')) {
                $this->line($note);
            }
        }
    }
649208
public function removeRoleBySlug($slug): int
    {
        $role = $this->roles()->where('slug', $slug)->first();

        return $this->roles()->detach($role);
    }
748058
function deleteProject(project) {
	return project.delete()
	.catch((error) => {
		console.error("Project with ID: " + project.id + " couldn't be deleted.");
		console.trace(error);
		throw error;
	});
}