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();
    }
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();
    }
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 ( ) ; }
Delete document type

@param $slug

@throws \Exception
Delete document type