Destroys a node type

@param int $id
@return NodeTypeContract
181619
public function destroy($id)
    {
        $model = $this->getModelName();

        $nodeType = $model::findOrFail($id);

        $this->builderService->destroyTable(
            $nodeType->getName(),
            $nodeType->getFieldKeys(),
            $nodeType->getKey()
        );

        $nodeType->delete();

        return $nodeType;
    }
274196
public function destroy($id)
    {
        $siteCurreny = $this->repository->find($id);
        $siteCurreny->delete();
        return redirect()->route('admin.site-currency.index');
    }
1336672
public function destroy($id)
    {
        $admin = $this->adminRepository->find($id);

        if (!is_null($admin)) {
            $this->adminRepository->destroy($admin);
        }

        return Redirect::route('admin.admin.index');
    }
517295
public function destroy($id)
    {
        $this->guardAgainstMissingParent('destroy');

        $this->shopify->delete($this->path($id));
    }
601409
public function destroy($id)
    {
        if(file_exists($this->path . DS . $id) && is_writable($this->path . DS . $id))
        {
            return unlink($this->path . DS . $id);
        }
        return false;
    }
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);
    }
1218130
public function destroy($id)
    {
        $post = $this->categoriaRepo->findOrFail($id);
        $post->delete();

        $message = 'El registro se eliminó satisfactoriamente.';

        return [
            'message' => $message
        ];
    }
27696
public function deleteNode($id)
    {
        $this->validate();
        
        $params = [
            'index' => $this->client->getIndex(),
            'type'  => $this->client->getType(),
            'id'    => $id,
        ];
        $responses = $this->client->getClient()->delete($params);
        return $responses['result'];
    }
999254
public function destroy($id)
    {
        try {
            $this->repository->delete($id);

            return $this->redirect('categories.index');
        } catch (ModelNotFoundException $e) {
            return $this->redirectNotFound();
        }
    }
658542
public function destroy($id)
    {
        $category = Category::findOrFail($id);
        $name = $category->name;
        $category->delete();

        Session::flash('status', trans('ticketit::lang.category-name-has-been-deleted', ['name' => $name]));

        \Cache::forget('ticketit::categories');

        return redirect()->action('\Kordy\Ticketit\Controllers\CategoriesController@index');
    }
816942
public function destroy($id)
	{
		$level = "danger";
		$message = " You are not permitted to destroy permissions.";

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

		return redirect()->route( config('watchtower.route.as') .'permission.index')
				->with( ['flash' => ['message' => $message, 'level' =>  $level] ] );
	}
1266853
public function destroy($id)
    {
        $user = \App\User::findOrfail($id);

        $user->delete();

        return redirect('scaffold-users');
    }
807747
public function destroy($id = null)
    {
        // ID has to be defined
        if (!isset($id)) {
            throw new \InvalidArgumentException('Undefined ID to destroy', 400);
        }

        // Perform before hook
        $this->beforeDestroy($id);

        // Update the model
        $result = $this->db()->table($this->table)->where($this->primaryKey, $id)->limit(1)->delete();

        // Return false on failures
        if (!$result) {
            throw new \Exception('Could not destroy the model', 500);
        }

        // Perform after hook
        $this->afterDestroy($id);

        // Return the destroyed model ID, or false on fail
        return $id;
    }
669315
public function destroy($id)
    {
        $product = Product::find($id);
        $product->delete();
        return JsonResponse::create(null, 204);
    }
598631
public function destroy($id)
    {
        $result = $this->service->destroy($id);

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

        return redirect('admin/features')->with('errors', ['Failed to delete']);
    }
947800
public function destroy($id)
    {
        $record = $this->modelRepository->findOrFail($id);

        if ( ! $this->isModelDeletable($record)) {
            return $this->failureResponse(
                $this->getLastUnmetDeleteConditionMessage()
            );
        }

        event( new Events\DeletingModelInCms($record) );

        if ( ! $this->deleteModel($record)) {
            // @codeCoverageIgnoreStart
            return $this->failureResponse(
                cms_trans('models.delete.failure.unknown')
            );
            // @codeCoverageIgnoreEnd
        }

        event( new Events\ModelDeletedInCms($this->getModelInformation()->modelClass(), $id) );

        if (request()->ajax()) {
            return response()->json([
                'success' => true,
            ]);
        }

        cms_flash(
            cms_trans(
                'models.delete.success-message',
                [ 'record' => $this->getSimpleRecordReference($id, $record) ]
            ),
            FlashLevel::SUCCESS
        );

        return redirect()->back();
    }
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,
        ]);
    }