AuthProvider::class, 'config' => ConfigProvider::class, 'instance' => InstanceProvider::class, 'operator' => OperatorProvider::class, 'service' => ServiceProvider::class, 'grpc' => GrpcFactory::class, ]; protected array $providers = []; public function __construct(protected Config $config) { } public function __get($name) { if (! isset($name) || ! isset($this->alias[$name])) { throw new InvalidArgumentException("{$name} is invalid."); } if (isset($this->providers[$name])) { return $this->providers[$name]; } $class = $this->alias[$name]; return $this->providers[$name] = new $class($this, $this->config); } }