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 1111use Illuminate \Support \Collection ;
1212use Illuminate \Support \ServiceProvider as IlluminateServiceProvider ;
1313use Override ;
14+ use ReflectionClass ;
1415use Symfony \Component \Finder \Finder ;
1516
1617class ServiceProvider extends IlluminateServiceProvider implements DeferrableProvider
@@ -26,7 +27,11 @@ public function provides(): array
2627 public function register (): void
2728 {
2829 $ 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+ ));
3035 });
3136
3237 $ this ->app ->alias (SqlEntityManager::class, 'sql-entities ' );
You can’t perform that action at this time.
0 commit comments