public function extendEntityManager(callable $closure) {
        // use 'em' instead of full class name to get around bug: https://github.com/laravel/framework/issues/11226
        if($this->app->resolved('em')) {
            $closure($this->app[EntityManager::class]);
        } else {
            $this->app->resolving(EntityManager::class, $closure);
        }
    }