public function __construct()
 {
     $this->middleware('admin');
     $root = Department::withTrashed()->find(Department::ROOT_DEPARTMENT);
     if (!$root) {
         $root = new Department();
         $root->name = '*';
         $root->acronym = '*';
         $root->display_name = '*';
         $root->department_id = null;
         $root->save();
         $root->id = Department::ROOT_DEPARTMENT;
         $root->save();
     } else {
         if ($root->trashed()) {
             $root->restore();
         }
         if ($root->department_id != null) {
             $root->department_id = null;
             $root->save();
         }
     }
     $more = Department::withTrashed()->whereDepartmentId(null)->where('id', '<>', Department::ROOT_DEPARTMENT);
     if ($more->count() > 0) {
         $more->update(['department_id' => Department::ROOT_DEPARTMENT]);
     }
 }