Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Eddi's avatar
Level 44

dynamic queue names in Horizon when using Forge

I already used Forge api to make dynamic queue names with different number of workers.

I plan to use Laravel Horizon and according to the Forge document it is recommended to use daemon for running queues and not introduce queues in the sites.

In Horizon config file the queues name becomes static but I need dynamic queue names. How should I handle dynamic queue names in Horizon/Forge combination?

0 likes
2 replies
Eddi's avatar
Level 44

At this moment in some jobs constructors, I have this:

        $this->onQueue($this->payment->getForgeQueueName());
        $this->onConnection('payment');

and getForgeQueueName() is a method to generate a variable name depending to the current payment model instance.

Please or to participate in this conversation.