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

vlauciani's avatar

L5.2 - How to use differente DB connection for Queue

Hi all

I’d like to use an SQLite DB for Queue, then:

  • I set my SQLite connection in the config/databases.php file
  • I run php artisan migrate --database=sqlite to create Job table in the SQLite DB

but now, what I’ve to set in the Listener to use this DataBase? In a Model, for example, I set $connection=sqlite but in the Listener?

Thank you.

0 likes
1 reply
vlauciani's avatar

I've solved by adding the connection key:

        'database' => [
            'driver' => 'database',
            'connection' => 'sqlite',
            'table' => 'jobs',
            'queue' => 'default',
            'expire' => 60,
        ],
1 like

Please or to participate in this conversation.