ayles-software/laravel-cloudflare-queue

Cloudflare queue driver for laravel.
7,724 6
Install
composer require ayles-software/laravel-cloudflare-queue
Latest Version:0.4.1
PHP:^8.4
License:MIT
Last Updated:Jun 7, 2026
Links: GitHub  ·  Packagist
Maintainer: parkourben99

Laravel Cloudflare Queue

A Laravel queue driver for Cloudflare Queues. This is still a work in progress.

Configuration

Add the following to your config/queue.php file:

'cloudflare' => [
    'driver' => 'cloudflare',
    'account_id'=> env('CLOUDFLARE_ACCOUNT_ID'),
    'queue_id'  => env('CLOUDFLARE_QUEUE_ID'),
    'api_token' => env('CLOUDFLARE_API_TOKEN'),
],

If are using CF workers and pushing raw jobs, you can set a raw handler that will be used to process the raw job:

'cloudflare' => [
    'driver' => 'cloudflare',
    'raw_handler' => CloudflareRawJobHandler::class,
    'account_id'=> env('CLOUDFLARE_ACCOUNT_ID'),
    'queue_id'  => env('CLOUDFLARE_QUEUE_ID'),
    'api_token' => env('CLOUDFLARE_API_TOKEN'),
],

Example of a raw CF job:

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

    public function __construct(public readonly array $data)
    {
        //
    }
    
    public function handle()
    {
        // do something
    }
}

Example of pushing a raw CF job to a Queue using JS:

export default {
    async fetch(request, env, context) {
        await env.MY_QUEUE.send({
            food: "lemons", 
        });

        return new Response('Ok');
    }
}

Testing

This package includes a comprehensive test suite using Pest PHP. To run the tests:

  1. Install dependencies:

    composer install
    
  2. Run the tests:

    ./vendor/bin/pest
    

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
0.4.1 ^8.4 ^12.0|^13.0 MIT
0.4.0 ^8.4 ^12.0|^13.0 MIT
0.3.1 ^8.4 ^12.0 MIT
0.3.0 ^8.4 ^12.0 MIT
0.2.0 ^8.4 ^12.0 MIT