feat: web, webhook and telegram channel drivers
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
20
core/app/Channels/ChannelRegistry.php
Normal file
20
core/app/Channels/ChannelRegistry.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user