/**
  *
  */
 public function __construct()
 {
     $this->middleware('admin');
     /*
      * check the ROOT_ITEM with a null parent
      * check all items with null parent to be ROOT_ITEM owned
      */
     $root = Category::withTrashed()->find(Category::ROOT_CATEGORY);
     if (!$root) {
         $root = new Category();
         $root->name = '*';
         $root->acronym = '*';
         $root->display_name = '*';
         $root->category_id = null;
         $root->save();
         $root->id = Category::ROOT_CATEGORY;
         $root->save();
     } else {
         if ($root->trashed()) {
             $root->restore();
         }
         if ($root->category_id != null) {
             $root->category_id = null;
             $root->save();
         }
     }
     Category::withTrashed()->whereCategoryId(null)->where('id', '<>', Category::ROOT_CATEGORY)->update(['category_id' => Category::ROOT_CATEGORY]);
 }