We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06bb814 commit 7426fcaCopy full SHA for 7426fca
src/ServiceProvider.php
@@ -11,6 +11,7 @@
11
use Illuminate\Support\Collection;
12
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
13
use Override;
14
+use ReflectionClass;
15
use Symfony\Component\Finder\Finder;
16
17
class ServiceProvider extends IlluminateServiceProvider implements DeferrableProvider
@@ -26,7 +27,11 @@ public function provides(): array
26
27
public function register(): void
28
{
29
$this->app->singleton(SqlEntityManager::class, function (Application $app) {
- return new SqlEntityManager($this->getEntities($app), $app->make('db'));
30
+ return (new ReflectionClass(SqlEntityManager::class))
31
+ ->newLazyGhost(fn ($m) => $m->__construct(
32
+ $this->getEntities($app),
33
+ $app->make('db'),
34
+ ));
35
});
36
37
$this->app->alias(SqlEntityManager::class, 'sql-entities');
0 commit comments