public function dispatchToQueue($command)
    {
        $connection = $command->connection ?? null;

        $queue = call_user_func($this->queueResolver, $connection);

        if (! $queue instanceof Queue) {
            throw new RuntimeException('Queue resolver did not return a Queue implementation.');
        }

        if (method_exists($command, 'queue')) {
            return $command->queue($queue, $command);
        }

        return $this->pushCommandToQueue($queue, $command);
    }
public function dispatchToQueue($command)
    {
        $connection = $command->connection ?? null;

        $queue = call_user_func($this->queueResolver, $connection);

        if (! $queue instanceof Queue) {
            throw new RuntimeException('Queue resolver did not return a Queue implementation.');
        }

        if (method_exists($command, 'queue')) {
            return $command->queue($queue, $command);
        }

        return $this->pushCommandToQueue($queue, $command);
    }
public function dispatchToQueue ( $ command ) { $ connection = $ command -> connection ?? null ; $ queue = call_user_func ( $ this -> queueResolver , $ connection ) ; if ( ! $ queue instanceof Queue ) { throw new RuntimeException ( 'Queue resolver did not return a Queue implementation.' ) ; } if ( method_exists ( $ command , 'queue' ) ) { return $ command -> queue ( $ queue , $ command ) ; } return $ this -> pushCommandToQueue ( $ queue , $ command ) ; }
Dispatch a command to its appropriate handler behind a queue.

@param  mixed  $command
@return mixed

@throws \RuntimeException
Dispatch a command to its appropriate handler behind a queue .