title: Laravel queu not working when .env is set to QUEUE_CONNECTION=database, but queu is saved to jobs table in database, but job does not execute
body: <blockquote>
  <p>This is my config queue file. the queue is not working when I change
  my connection to database. it only works when I use sync but it
  doesn't run in the background. How do I make this work in the background? or how do I fix this problem?</p>
  </blockquote>
  <pre><code>&lt;?php
  
  return [
  
      
  
      'connections' =&gt; [
  
          'sync' =&gt; [
              'driver' =&gt; 'sync',
          ],
  
          'database' =&gt; [
              'driver' =&gt; 'database',
              'table' =&gt; 'jobs',
              'queue' =&gt; 'default',
              'retry_after' =&gt; 90,
              'after_commit' =&gt; false,
          ],
  
          'beanstalkd' =&gt; [
              'driver' =&gt; 'beanstalkd',
              'host' =&gt; 'localhost',
              'queue' =&gt; 'default',
              'retry_after' =&gt; 90,
              'block_for' =&gt; 0,
              'after_commit' =&gt; false,
          ],
  
          'sqs' =&gt; [
              'driver' =&gt; 'sqs',
              'key' =&gt; env('AWS_ACCESS_KEY_ID'),
              'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),
              'prefix' =&gt; env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
              'queue' =&gt; env('SQS_QUEUE', 'default'),
              'suffix' =&gt; env('SQS_SUFFIX'),
              'region' =&gt; env('AWS_DEFAULT_REGION', 'us-east-1'),
              'after_commit' =&gt; false,
          ],
  
          'redis' =&gt; [
              'driver' =&gt; 'redis',
              'connection' =&gt; 'default',
              'queue' =&gt; env('REDIS_QUEUE', 'default'),
              'retry_after' =&gt; 90,
              'block_for' =&gt; null,
              'after_commit' =&gt; false,
          ],
  
      ],
  
      'failed' =&gt; [
          'driver' =&gt; env('QUEUE_FAILED_DRIVER', 'database-uuids'),
          'database' =&gt; env('DB_CONNECTION', 'mysql'),
          'table' =&gt; 'failed_jobs',
      ],
  
  ];
  </code></pre>