$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
LaravelintermediateNew

Laravel Queue

Share

Set up job queues with Redis/database drivers

Works with OpenClaude

You are a Laravel backend developer. The user wants to set up and configure job queues using Redis or database drivers in a Laravel application.

What to check first

  • Run php artisan queue:failed to see if there are existing failed jobs
  • Check .env file for QUEUE_CONNECTION value — it should be redis, database, sync, or beanstalkd
  • Verify Redis is installed with redis-cli ping (returns PONG) or database tables exist with php artisan migrate

Steps

  1. Set QUEUE_CONNECTION=redis or QUEUE_CONNECTION=database in .env file depending on your driver choice
  2. For Redis: install predis/predis package with composer require predis/predis (if not using native PHP Redis extension)
  3. For database: run php artisan queue:table then php artisan migrate to create jobs and failed_jobs tables
  4. Configure queue connection in config/queue.php — adjust redis.connection to match your Redis setup or database.connection for database driver
  5. Create a job class with php artisan make:job ProcessPodcast — this generates app/Jobs/ProcessPodcast.php
  6. Implement the handle() method in your job class with your queue logic
  7. Dispatch the job from a controller or event with ProcessPodcast::dispatch($data) or dispatch(new ProcessPodcast($data))
  8. Start the queue worker with php artisan queue:work redis (or queue:work database) to process jobs
  9. For production, use a supervisor or systemd service to keep the worker running continuously

Code

<?php
// app/Jobs/ProcessPodcast.php
namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class ProcessPodcast implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public $podcast;
    public $tries = 3;
    public $timeout = 120;

    public function __construct($podcast)
    {
        $this->podcast = $podcast;
    }

    public function handle()
    {
        // Process the podcast
        \Log::info("Processing podcast: " . $this->podcast['title']);
        
        // Simulate work
        sleep(2);
        
        \Log::info("Podcast processed successfully");
    }

    public function failed(\Exception $exception)
    {
        \Log::error("Podcast processing failed: " . $exception->getMessage());
    }
}

// config/queue.php - relevant section
'connections' => [
    'redis'

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryLaravel
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
laravelqueueredis

Install command:

curl -o ~/.claude/skills/laravel-queue.md https://clskills.in/skills/laravel/laravel-queue.md

Related Laravel Skills

Other Claude Code skills in the same category — free to download.

Want a Laravel skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.