original_string: public function categoriesDelete(Request $request, Response $response)
      {
          if ($check = $this->sentinel->hasPerm('blog_categories.delete', 'dashboard', $this->config['blog-enabled'])) {
              return $check;
          }
  
          $category = BC::find($request->getParam('category_id'));
  
          if (!$category) {
              $this->flash('danger', 'Category doesn\'t exist.');
              return $this->redirect($response, 'admin-blog');
          }
  
          if ($category->delete()) {
              $this->flash('success', 'Category has been removed.');
              return $this->redirect($response, 'admin-blog');
          }
  
          $this->flash('danger', 'There was a problem removing the category.');
          return $this->redirect($response, 'admin-blog');
      }
code: public function categoriesDelete(Request $request, Response $response)
      {
          if ($check = $this->sentinel->hasPerm('blog_categories.delete', 'dashboard', $this->config['blog-enabled'])) {
              return $check;
          }
  
          $category = BC::find($request->getParam('category_id'));
  
          if (!$category) {
              $this->flash('danger', 'Category doesn\'t exist.');
              return $this->redirect($response, 'admin-blog');
          }
  
          if ($category->delete()) {
              $this->flash('success', 'Category has been removed.');
              return $this->redirect($response, 'admin-blog');
          }
  
          $this->flash('danger', 'There was a problem removing the category.');
          return $this->redirect($response, 'admin-blog');
      }
code_tokens: public function categoriesDelete ( Request $ request , Response $ response ) { if ( $ check = $ this -> sentinel -> hasPerm ( 'blog_categories.delete' , 'dashboard' , $ this -> config [ 'blog-enabled' ] ) ) { return $ check ; } $ category = BC :: find ( $ request -> getParam ( 'category_id' ) ) ; if ( ! $ category ) { $ this -> flash ( 'danger' , 'Category doesn\'t exist.' ) ; return $ this -> redirect ( $ response , 'admin-blog' ) ; } if ( $ category -> delete ( ) ) { $ this -> flash ( 'success' , 'Category has been removed.' ) ; return $ this -> redirect ( $ response , 'admin-blog' ) ; } $ this -> flash ( 'danger' , 'There was a problem removing the category.' ) ; return $ this -> redirect ( $ response , 'admin-blog' ) ; }
docstring: Delete Blog Category
docstring_tokens: Delete Blog Category