Files
hado/core/app/Channels/ChannelRegistry.php
2026-09-04 07:18:37 -03:00

21 lines
568 B
PHP

<?php
namespace App\Channels;
use App\Enums\ChannelType;
use Illuminate\Contracts\Container\Container;
final class ChannelRegistry
{
public function __construct(private readonly Container $container) {}
public function for(ChannelType $type): ChannelDriver
{
return match ($type) {
ChannelType::Web => $this->container->make(WebChannel::class),
ChannelType::Webhook => $this->container->make(WebhookChannel::class),
ChannelType::Telegram => $this->container->make(TelegramChannel::class),
};
}
}