code: public function handle()
      {
          if (count($this->routes) == 0) {
              return $this->error("Application doesn't have any routes.");
          }
  
          $routes = $this->getRoutes();
          $global = \Unite\UnisysApi\Models\Permission::getGlobalPermissions();
  
          $permissions = $routes->merge($global);
  
          Permission::all()->each(function (Permission $permission) use($permissions) {
              if(!$permissions->contains($permission->name)) {
                  $permission->delete();
              }
          });
  
          $permissions->each(function ($name) {
              try {
                  Permission::findByName($name);
              } catch (PermissionDoesNotExist $e) {
                  Permission::create(['name' => $name]);
              }
          });
  
          $this->info('Permissions was synced');
      }
docs: /*
  Execute the console command.