PHPackages                             coverzen/configurable-sqs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. coverzen/configurable-sqs

ActiveLibrary

coverzen/configurable-sqs
=========================

Package to utilize laravel queue:work command to listen to Amazon SQS message with configurable schemas

v1.3.0(5mo ago)16.3k↓50%[1 PRs](https://github.com/coverzen/configurable-sqs/pulls)MITPHPPHP ^8.2||^8.3CI passing

Since Jun 3Pushed 5mo ago3 watchersCompare

[ Source](https://github.com/coverzen/configurable-sqs)[ Packagist](https://packagist.org/packages/coverzen/configurable-sqs)[ RSS](/packages/coverzen-configurable-sqs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (16)Versions (11)Used By (0)

Configurable sqs subscriber for laravel
=======================================

[](#configurable-sqs-subscriber-for-laravel)

[![Build Status](https://github.com/coverzen/configurable-sqs/actions/workflows/ci.yml/badge.svg)](https://github.com/coverzen/configurable-sqs/actions/workflows/ci.yml/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/70d667500f7082b418dd11410e01a984db51b8eb7ad8e7af19584acea1149c0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f7665727a656e2f636f6e666967757261626c652d737173)](https://camo.githubusercontent.com/70d667500f7082b418dd11410e01a984db51b8eb7ad8e7af19584acea1149c0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f7665727a656e2f636f6e666967757261626c652d737173)[![License](https://camo.githubusercontent.com/5f8a9e690cc79690a43dfdd7e8184fadf9bc1ad7e2dde910a0fd4c8dc65e4430/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f7665727a656e2f636f6e666967757261626c652d737173)](https://camo.githubusercontent.com/5f8a9e690cc79690a43dfdd7e8184fadf9bc1ad7e2dde910a0fd4c8dc65e4430/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f7665727a656e2f636f6e666967757261626c652d737173)

This package provides a simple way to subscribe to an AWS SQS queue in Laravel. The package is designed to be as simple as possible to use, with a simple configuration for redirect any message to a specific listener. On Classic Laravel Listeners is possible add a `enqueueFilter` method to filter the message before the job is enqueued to SQS.

Installation
------------

[](#installation)

```
composer require coverzen/configurable-sqs
```

Configuration
-------------

[](#configuration)

First, you need to add the following environment variables to your `.env` file:

```
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_DEFAULT_REGION=your-region
AWS_ACCOUNT_ID=your-account-id
```

Then, you need to add the following configuration to your `config/queue.php` file:

```
'connections' => [

    ...

    'configurable-sqs' => [
        'driver' => 'configurable-sqs',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'prefix' => 'https://sqs.'.env('AWS_DEFAULT_REGION').'.amazonaws.com/'.env('AWS_ACCOUNT_ID').'/',
        'queue' => 'your-queue-name',
        'suffix' => '',
        'region' => env('AWS_DEFAULT_REGION'),
        'has_consumer' => true,
    ],
]
```

Usage
-----

[](#usage)

To subscribe custom listener to a queue, you need to create a new listener class and configure it in the `configurable-sqs.php` file.

```
    'your-queue-name' => [
        [
            'type' => ConfigurableJob::TYPE_SQS_SIMPLE_PAYLOAD,
            'search' => [
                'key' => 'message',
                'value' => 'test',
            ],
            'listener' => YourListener::class,
        ],
        [
            'type' => ConfigurableJob::TYPE_SQS_REGEX_PAYLOAD,
            'search' => [
                'key' => 'message',
                'value' => '/^test$/i',
            ],
            'listener' => YourListener::class,
        ],
        [
            'type' => ConfigurableJob::TYPE_SNS_FROM,
            'arn' => 'arn:aws:sns:eu-south-1:0000000000:HelloWorld',
            'listener' => YourListener::class,
        ],
    ],
```

The `type` key can be one of the following values:

- `ConfigurableJob::TYPE_SQS_SIMPLE_PAYLOAD`: This type will search for a specific key and value in the SQS message.
- `ConfigurableJob::TYPE_SQS_REGEX_PAYLOAD`: This type will search for a specific key and value in the SQS message using a regex pattern.
- `ConfigurableJob::TYPE_SNS_FROM`: This type will search for a specific SNS ARN in the SQS message.

The listener class can implement the `Coverzen\ConfigurableSqs\Interfaces\ListenerInterface` interface.

```
namespace App\Listeners;

YourListener implements ListenerInterface
{
    public function handle(array $message): void
    {
        // Your logic here
    }
}
```

Simple SQS message job
----------------------

[](#simple-sqs-message-job)

ExampleSimpleSQSJob.php

```
use Coverzen\ConfigurableSqs\Job\SimpleSQSJob;

class ExampleSimpleSQSJob extends SimpleSQSJob
{
    protected string $event = 'example';

    public function __construct($data)
    {
        parent::__construct($data);
    }
}
```

EventTrigger.php

```
use App\Jobs\ExampleSimpleSQSJob;

class EventTrigger
{
    public function trigger()
    {
        ExampleSimpleSQSJob::dispatch([
            'message' => 'test',
        ]);
    }
}
```

When the `EventTrigger::trigger()` class is executed the `ExampleSimpleSQSJob` will be dispatched to queue trough sqs-configurable driver using a simple message payload as:

```
{
    "event": "example",
    "data": {
        "message": "test"
    }
}
```

Filter message before job is enqueued
-------------------------------------

[](#filter-message-before-job-is-enqueued)

You can add a `enqueueFilter` method to your listener class to filter the message before the job is enqueued to SQS.

```
namespace App\Listeners;

use App\Events\MyEvent;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;

class TestListener implements ShouldQueue
{
    use Queueable;

    public static function enqueueFilter(MyEvent $event): bool
    {
        // Your logic here
        // If you return false the job will not be enqueued
        return true;
    }

    public function handle(MyEvent $event): bool
    {
        return true;
    }
}
```

Sending only queue configuration
--------------------------------

[](#sending-only-queue-configuration)

If you want to send only the queue configuration, you need turn to false has\_consumer configuration option.

```
'connections' => [

    ...

    'configurable-sqs-send-only' => [
        'driver' => 'configurable-sqs',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'prefix' => 'https://sqs.'.env('AWS_DEFAULT_REGION').'.amazonaws.com/'.env('AWS_ACCOUNT_ID').'/',
        'queue' => 'your-queue-name',
        'suffix' => '',
        'region' => env('AWS_DEFAULT_REGION'),
        'has_consumer' => false,
    ],
]
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

Credits
-------

[](#credits)

- [Coverzen](https://www.coverzen.it)

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance70

Regular maintenance activity

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 51.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~91 days

Recently: every ~108 days

Total

7

Last Release

166d ago

PHP version history (2 changes)v1.0.0PHP ^8.2

v1.3.0PHP ^8.2||^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/43edd78402ad4d656d3744f715b19b407b8d5c0f3d845473a7021818acb22a9d?d=identicon)[coverzen](/maintainers/coverzen)

---

Top Contributors

[![fgiova](https://avatars.githubusercontent.com/u/1685354?v=4)](https://github.com/fgiova "fgiova (16 commits)")[![giraz82](https://avatars.githubusercontent.com/u/5285724?v=4)](https://github.com/giraz82 "giraz82 (8 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (7 commits)")

---

Tags

laravelsqssqs-consumerworker

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/coverzen-configurable-sqs/health.svg)

```
[![Health](https://phpackages.com/badges/coverzen-configurable-sqs/health.svg)](https://phpackages.com/packages/coverzen-configurable-sqs)
```

###  Alternatives

[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M790](/packages/league-flysystem-aws-s3-v3)[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[humanmade/s3-uploads

WordPress plugin to store uploads on S3

2.1k2.4M9](/packages/humanmade-s3-uploads)[bref/laravel-bridge

An advanced Laravel integration for Bref, including Octane support.

3384.1M11](/packages/bref-laravel-bridge)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)[laravel-notification-channels/aws-sns

Amazon Simple Notification Service (AWS SNS) notification channel for Laravel.

541.1M2](/packages/laravel-notification-channels-aws-sns)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
