Laravel - Events - Customizing The Queue Connection Queue Name

If you would like to customize the queue connection, queue name, or queue delay time of an event listener, you may define the $connection, $queue, or $delay properties on your listener class:

    
    

If you would like to define the listener's queue connection or queue name at runtime, you may define viaConnection or viaQueue methods on the listener:

    
    /**
     * Get the name of the listener's queue connection.
     *
     * @return string
     */
    public function viaConnection()
    {
        return 'sqs';
    }
    
    /**
     * Get the name of the listener's queue.
     *
     * @return string
     */
    public function viaQueue()
    {
        return 'listeners';
    }