map([$schemaService, 'fromArray']); $channel = new Channel( name: config("lucent.name") ?? "", url: rtrim( config("lucent.url") ?? "", "/"), previewTarget: rtrim( config("lucent.previewTarget") ?? "", "/"), generateCommand: config("lucent.generateCommand") ?? "", schemas: $schemasCollection, imageFilters: config("lucent.imageFilters") ?? [], ); $channelService = new ChannelService($schemaService); $channelService->channel = $channel; return $channelService; } /** * @param string $name * @return Option */ public function getSchema(string $name): Option { $schema = $this->channel->schemas->firstWhere("name", $name); if (empty($schema)) { return none(); } return some($schema); } }