diff --git a/src/queue/src/Console/ListenCommand.php b/src/queue/src/Console/ListenCommand.php index b18e895c8..95b788471 100644 --- a/src/queue/src/Console/ListenCommand.php +++ b/src/queue/src/Console/ListenCommand.php @@ -36,16 +36,13 @@ class ListenCommand extends Command */ protected string $description = 'Listen to a given queue'; - /** - * The queue listener instance. - */ - protected Listener $listener; - /** * Create a new queue listen command. */ - public function __construct(Listener $listener) - { + public function __construct( + protected ConfigInterface $config, + protected Listener $listener + ) { parent::__construct(); $this->setOutputHandler($this->listener = $listener); @@ -77,9 +74,9 @@ public function handle() */ protected function getQueue(?string $connection): string { - $connection = $connection ?: $this->app->get(ConfigInterface::class)->get('queue.default'); + $connection = $connection ?: $this->config->get('queue.default'); - return $this->input->getOption('queue') ?: $this->app->get(ConfigInterface::class)->get( + return $this->input->getOption('queue') ?: $this->config->get( "queue.connections.{$connection}.queue", 'default' );