app->singleton('Doctrine\ORM\EntityManager', function ($app) { $paths = [app_path('models')]; $isDevMode = config('app.debug'); // the connection configuration $dbParams = config('database.doctrine'); $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode); return EntityManager::create($dbParams, $config); }); } }