public function delete($lang, $id)
    {
        if(!User::hasAccess('Categories', 'delete')) {
            return $this->noPermission();
        }

        $categoryDeleteRes = $this->deleteCategory($id);
        if(gettype($categoryDeleteRes) == "boolean") {
            if($categoryDeleteRes) {
                return $this->response('Category could not be deleted.', 500);
            }
        }else{
            return $categoryDeleteRes;
        }

        return $this->response('Category could not be deleted. Please try again later or contact your Administrator!', 500);
    }
public function delete($lang, $id)
    {
        if(!User::hasAccess('Categories', 'delete')) {
            return $this->noPermission();
        }

        $categoryDeleteRes = $this->deleteCategory($id);
        if(gettype($categoryDeleteRes) == "boolean") {
            if($categoryDeleteRes) {
                return $this->response('Category could not be deleted.', 500);
            }
        }else{
            return $categoryDeleteRes;
        }

        return $this->response('Category could not be deleted. Please try again later or contact your Administrator!', 500);
    }
public function delete ( $ lang , $ id ) { if ( ! User :: hasAccess ( 'Categories' , 'delete' ) ) { return $ this -> noPermission ( ) ; } $ categoryDeleteRes = $ this -> deleteCategory ( $ id ) ; if ( gettype ( $ categoryDeleteRes ) == "boolean" ) { if ( $ categoryDeleteRes ) { return $ this -> response ( 'Category could not be deleted.' , 500 ) ; } } else { return $ categoryDeleteRes ; } return $ this -> response ( 'Category could not be deleted. Please try again later or contact your Administrator!' , 500 ) ; }
Delete a Category and his children.

@param  string $lang
@param  int    $id
@return array|bool
@throws \Exception
Delete a Category and his children .