File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11
11
use Illuminate \Support \Collection ;
12
12
use Illuminate \Support \ServiceProvider as IlluminateServiceProvider ;
13
13
use Override ;
14
+ use ReflectionClass ;
14
15
use Symfony \Component \Finder \Finder ;
15
16
16
17
class ServiceProvider extends IlluminateServiceProvider implements DeferrableProvider
@@ -26,7 +27,11 @@ public function provides(): array
26
27
public function register (): void
27
28
{
28
29
$ this ->app ->singleton (SqlEntityManager::class, function (Application $ app ) {
29
- 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
+ ));
30
35
});
31
36
32
37
$ this ->app ->alias (SqlEntityManager::class, 'sql-entities ' );
You can’t perform that action at this time.
0 commit comments