public function registerProxyAutoloader()
    {
        $this->app->afterResolving(ManagerRegistry::class, function (ManagerRegistry $registry) {
            /** @var EntityManagerInterface $manager */
            foreach ($registry->getManagers() as $manager) {
                Autoloader::register(
                    $manager->getConfiguration()->getProxyDir(),
                    $manager->getConfiguration()->getProxyNamespace()
                );
            }
        });
    }