public function create(string $name): Channel
    {
        if (!array_has($this->channels, $name)) {
            throw new ChannelNotFound('Channel `'.$name.'` not found.');
        }

        $parameters = $this->channels[$name];

        // Create driver and initialize it with channel parameters
        $driver = $this->createDriver($parameters['driver']);
        $driver->initialize(collect($parameters)->except('driver'));

        return new Channel($name, $driver, $parameters['webhook-secret'] ?? null);
    }
public function create(string $name): Channel
    {
        if (!array_has($this->channels, $name)) {
            throw new ChannelNotFound('Channel `'.$name.'` not found.');
        }

        $parameters = $this->channels[$name];

        // Create driver and initialize it with channel parameters
        $driver = $this->createDriver($parameters['driver']);
        $driver->initialize(collect($parameters)->except('driver'));

        return new Channel($name, $driver, $parameters['webhook-secret'] ?? null);
    }
public function create ( string $ name ) : Channel { if ( ! array_has ( $ this -> channels , $ name ) ) { throw new ChannelNotFound ( 'Channel `' . $ name . '` not found.' ) ; } $ parameters = $ this -> channels [ $ name ] ; // Create driver and initialize it with channel parameters $ driver = $ this -> createDriver ( $ parameters [ 'driver' ] ) ; $ driver -> initialize ( collect ( $ parameters ) -> except ( 'driver' ) ) ; return new Channel ( $ name , $ driver , $ parameters [ 'webhook-secret' ] ?? null ) ; }
Create channel.

@param string $name

@return Channel
@throws ChannelNotFound
Create channel .