PHPackages                             charliepage88/laravel-aws-worker - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. charliepage88/laravel-aws-worker

ActiveLibrary[Queues &amp; Workers](/categories/queues)

charliepage88/laravel-aws-worker
================================

Run Laravel (or Lumen) tasks and queue listeners inside of AWS Elastic Beanstalk workers

v0.1.17(7y ago)14MITPHPPHP &gt;=5.5.0

Since Jun 2Pushed 6y agoCompare

[ Source](https://github.com/charliepage88/laravel-aws-worker)[ Packagist](https://packagist.org/packages/charliepage88/laravel-aws-worker)[ Docs](https://github.com/dusterio/laravel-aws-worker)[ RSS](/packages/charliepage88-laravel-aws-worker/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (7)Versions (19)Used By (0)

laravel-aws-worker
==================

[](#laravel-aws-worker)

[![Build Status](https://camo.githubusercontent.com/ad578a4b4189d39bc98ea4ac715a3c4cba065b5989f8461c8206abd81915754c/68747470733a2f2f7472617669732d63692e6f72672f647573746572696f2f6c61726176656c2d6177732d776f726b65722e737667)](https://travis-ci.org/dusterio/laravel-aws-worker)[![Code Climate](https://camo.githubusercontent.com/f6185429fa46bd204a3bf84c670565387f422a6ff1154b3615ec4933c8ae6d0d/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f647573746572696f2f6c61726176656c2d6177732d776f726b65722f6261646765732f6770612e737667)](https://codeclimate.com/github/dusterio/laravel-aws-worker/badges)[![Total Downloads](https://camo.githubusercontent.com/e78b53c6da662edb608fc1742b08eb66ab8c2846ec77dd1168ab08808592a32d/68747470733a2f2f706f7365722e707567782e6f72672f647573746572696f2f6c61726176656c2d6177732d776f726b65722f642f746f74616c2e737667)](https://packagist.org/packages/dusterio/laravel-aws-worker)[![Latest Stable Version](https://camo.githubusercontent.com/a3e7290e6cfe6155c63aef1ffe90aea9cf0a5194a31096e27dc2997d61320c6d/68747470733a2f2f706f7365722e707567782e6f72672f647573746572696f2f6c61726176656c2d6177732d776f726b65722f762f737461626c652e737667)](https://packagist.org/packages/dusterio/laravel-aws-worker)[![Latest Unstable Version](https://camo.githubusercontent.com/9e93cd55f3bf5e65e593465c5f3b9582a01fdf04a2033a7b1ecd4177fc83d680/68747470733a2f2f706f7365722e707567782e6f72672f647573746572696f2f6c61726176656c2d6177732d776f726b65722f762f756e737461626c652e737667)](https://packagist.org/packages/dusterio/laravel-aws-worker)[![License](https://camo.githubusercontent.com/138af506dc1b3c1f1f56f9955965915b12aecfa5725ea002ce5b3bfea8872092/68747470733a2f2f706f7365722e707567782e6f72672f647573746572696f2f6c61726176656c2d6177732d776f726b65722f6c6963656e73652e737667)](https://packagist.org/packages/dusterio/laravel-plain-sqs)

Run Laravel (or Lumen) tasks and queue listeners inside of AWS Elastic Beanstalk workers

Credit
------

[](#credit)

Package created by:

[![dusterio](https://github.com/dusterio/laravel-aws-worker)](https://github.com/dusterio/laravel-aws-worker)

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

[](#installation)

Create a web beanstalk environment and a worker beanstalk environment.

Dependencies
------------

[](#dependencies)

- PHP &gt;= 7.1.3
- Laravel &gt;= 5.8

Installation via Composer
-------------------------

[](#installation-via-composer)

To install simply run:

```
composer require charliepage88/laravel-aws-worker

```

### Worker

[](#worker)

#### Configuring the queue

[](#configuring-the-queue)

Every time you create a worker environment in AWS, you are forced to choose two SQS queues – either automatically generated ones or some of your existing queues. One of the queues will be for the jobs themselves, another one is for failed jobs – AWS calls this queue a dead letter queue.

You can set your worker queues either during the environment launch or anytime later in the settings:

[![AWS Worker queue settings](https://camo.githubusercontent.com/553d012c12241183043816d94248d8dfb0e034891268416e04568302a28b5aa7/68747470733a2f2f7777772e6d7973656e6b6f2e636f6d2f696d616765732f776f726b65725f73657474696e67732e6a7067)](https://camo.githubusercontent.com/553d012c12241183043816d94248d8dfb0e034891268416e04568302a28b5aa7/68747470733a2f2f7777772e6d7973656e6b6f2e636f6d2f696d616765732f776f726b65725f73657474696e67732e6a7067)

Don't forget to set the HTTP path to `/worker/queue` – this is where AWS will hit our application. If you chose to generate queues automatically, you can see their details later in SQS section of the AWS console:

[![AWS SQS details](https://camo.githubusercontent.com/171f0cef63ff19b6775eb274cd7af6547b3036df257617cc53182e416e5434c3/68747470733a2f2f7777772e6d7973656e6b6f2e636f6d2f696d616765732f7371735f64657461696c732e6a7067)](https://camo.githubusercontent.com/171f0cef63ff19b6775eb274cd7af6547b3036df257617cc53182e416e5434c3/68747470733a2f2f7777772e6d7973656e6b6f2e636f6d2f696d616765732f7371735f64657461696c732e6a7067)

You have to tell Laravel about this queue. First set your queue driver to SQS in `.env` file:

```
QUEUE_DRIVER=sqs

```

Then go to `config/queue.php` and copy/paste details from AWS console:

```
        ...
        'sqs' => [
            'driver' => 'sqs',
            'key' => 'your-public-key',
            'secret' => 'your-secret-key',
            'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id',
            'queue' => 'your-queue-name',
            'region' => 'us-east-1',
        ],
        ...
```

To generate key and secret go to Identity and Access Management in the AWS console. It's better to create a separate user that ONLY has access to SQS.

### Notes

[](#notes)

Create a `cron.yaml` file inside project root with following contents:

```
version: 1
cron:
 - name: "schedule"
   url: "/worker/schedule"
   schedule: "* * * * *"
```

Inside of your `.env` file, set `REGISTER_WORKER_ROUTES` to `true`.

Update SQS config info to point to a different SQS queue than what the worker is using. During testing thus far, this has resulted in high accuracy of jobs being processed.

Do not have the scheduler run via cron, since the `cron.yaml` will take care of that.

Use supervisor to make sure the queue is running. When a job hits the worker, the queue will be necessary to enter the Job and process.

### Web

[](#web)

Inside of your `.env` file, set `REGISTER_WORKER_ROUTES` to `false`.

Update SQS config info to point to created worker environment.

Do not have the scheduler run via cron and make sure the queue is set to `sqs`.

Use supervisor to make sure the queue is running and sending jobs to the worker beanstalk.

Errors and exceptions
---------------------

[](#errors-and-exceptions)

Please make sure that two special routes are not mounted behind a CSRF middleware. Our POSTs are not real web forms and CSRF is not necessary here. If you have a global CSRF middleware, add these routes to exceptions, or otherwise apply CSRF to specific routes or route groups.

If your job fails, we will throw a `FailedJobException`. If you want to customize error output – just customise your exception handler. Note that your HTTP status code must be different from 200 in order for AWS to realize the job has failed.

TODO
----

[](#todo)

1. Add support for AWS dead letter queue (retry jobs from that queue?)

Implications
------------

[](#implications)

Note that AWS cron doesn't promise 100% time accuracy. Since cron tasks share the same queue with other jobs, your scheduled tasks may be processed later than expected.

Post scriptum
-------------

[](#post-scriptum)

I wrote a [blog post](https://blog.menara.com.au/2016/06/running-laravel-in-amazon-elastic-beanstalk/) explaining how this actually works.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~58 days

Recently: every ~96 days

Total

18

Last Release

2632d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a56c6df8814450142df3d439f74166510f51674f9a84f8790e93a46af7ea3b4b?d=identicon)[charliepage](/maintainers/charliepage)

---

Top Contributors

[![dusterio](https://avatars.githubusercontent.com/u/11039918?v=4)](https://github.com/dusterio "dusterio (24 commits)")[![gcg](https://avatars.githubusercontent.com/u/811685?v=4)](https://github.com/gcg "gcg (1 commits)")[![charliepage88](https://avatars.githubusercontent.com/u/1620217?v=4)](https://github.com/charliepage88 "charliepage88 (1 commits)")[![gtlkirit](https://avatars.githubusercontent.com/u/17121399?v=4)](https://github.com/gtlkirit "gtlkirit (1 commits)")[![nadge](https://avatars.githubusercontent.com/u/3862793?v=4)](https://github.com/nadge "nadge (1 commits)")[![organiseio](https://avatars.githubusercontent.com/u/20773101?v=4)](https://github.com/organiseio "organiseio (1 commits)")[![gilbitron](https://avatars.githubusercontent.com/u/203882?v=4)](https://github.com/gilbitron "gilbitron (1 commits)")

---

Tags

phplaravelawslumensqselasticbeanstalkworker

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/charliepage88-laravel-aws-worker/health.svg)

```
[![Health](https://phpackages.com/badges/charliepage88-laravel-aws-worker/health.svg)](https://phpackages.com/packages/charliepage88-laravel-aws-worker)
```

###  Alternatives

[dusterio/laravel-aws-worker

Run Laravel (or Lumen) tasks and queue listeners inside of AWS Elastic Beanstalk workers

3105.7M](/packages/dusterio-laravel-aws-worker)[dusterio/laravel-plain-sqs

Custom SQS connector for Laravel that supports custom format JSON

1352.7M1](/packages/dusterio-laravel-plain-sqs)[shiftonelabs/laravel-sqs-fifo-queue

Adds a Laravel queue driver for Amazon SQS FIFO queues.

1556.0M3](/packages/shiftonelabs-laravel-sqs-fifo-queue)[joblocal/laravel-sqs-sns-subscription-queue

A simple Laravel service provider which adds a new queue connector to handle SNS subscription queues.

48416.3k](/packages/joblocal-laravel-sqs-sns-subscription-queue)

PHPackages © 2026

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