static function treeItems($route_show, $id, $indent, $name)
 {
     if ($indent < 15) {
         $items = Category::withTrashed()->whereCategoryId($id)->orderBy('order')->orderBy('name')->get();
         if ($items->count() > 0) {
             static::$treeResult .= PHP_EOL . '<ul>';
             foreach ($items as $item) {
                 static::$treeResult .= PHP_EOL . '<li>' . link_to_route($route_show, $item->name, ['id' => $item->id]) . ' - ' . ($item->trashed() ? '<del>' . e($item->display_name) . '</del>' : e($item->display_name));
                 static::treeItems($route_show, $item->id, $indent + 1, $item->name);
                 static::$treeResult .= PHP_EOL . '</li>';
             }
             static::$treeResult .= PHP_EOL . '</ul>';
         }
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id, DeleteRequest $request)
 {
     if ($id == Category::ROOT_CATEGORY) {
         $categories = Category::ListItems();
         $model = $this->getModel($id);
         Flash::warning(trans($this->resource_name . 'forbidden'));
         return view($this->show_view, compact(['model', 'categories']));
     }
     try {
         $model = $this->getModel($id);
         $model->delete();
         Flash::info(trans($this->resource_name . 'sent_to_trash', ['model' => $this->model_name]));
         if ($this->show_trash()) {
             return redirect(route($this->show_route, [$id]));
         } else {
             return redirect(route($this->index_route));
         }
     } catch (Exception $e) {
         if ($e instanceof PDOException) {
             Flash::error($e->errorInfo[2]);
         } else {
             Flash::error($e->getMessage());
         }
         return $request->response([]);
     }
 }