public function destroy($id)
    {
        $model = $this->getModelName();

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

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

        $nodeType->delete();

        return $nodeType;
    }
public function destroy($id)
    {
        $model = $this->getModelName();

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

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

        $nodeType->delete();

        return $nodeType;
    }
public function destroy ( $ id ) { $ model = $ this -> getModelName ( ) ; $ nodeType = $ model :: findOrFail ( $ id ) ; $ this -> builderService -> destroyTable ( $ nodeType -> getName ( ) , $ nodeType -> getFieldKeys ( ) , $ nodeType -> getKey ( ) ) ; $ nodeType -> delete ( ) ; return $ nodeType ; }
Destroys a node type

@param int $id
@return NodeTypeContract
Destroys a node type