PHPackages                             fleethunttech/laravel-google-cloud-tasks-queue - 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. fleethunttech/laravel-google-cloud-tasks-queue

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

fleethunttech/laravel-google-cloud-tasks-queue
==============================================

v2.1.4(4y ago)03.7kMITPHP

Since Jun 17Pushed 4y agoCompare

[ Source](https://github.com/FleetHuntTech/laravel-google-cloud-tasks-queue)[ Packagist](https://packagist.org/packages/fleethunttech/laravel-google-cloud-tasks-queue)[ RSS](/packages/fleethunttech-laravel-google-cloud-tasks-queue/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (6)Versions (12)Used By (0)

 [![](/logo.png)](/logo.png)

[![Build Status](https://github.com/stackkit/laravel-google-cloud-tasks-queue/workflows/Run%20tests/badge.svg?branch=master)](https://github.com/stackkit/laravel-google-cloud-tasks-queue/workflows/Run%20tests/badge.svg?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/3e0ac959c6a79932804773f9a7aaaab8d90bba50d2ffd0211fe754f0ac86dbfe/68747470733a2f2f706f7365722e707567782e6f72672f737461636b6b69742f6c61726176656c2d676f6f676c652d636c6f75642d7461736b732d71756575652f762f737461626c652e737667)](https://packagist.org/packages/stackkit/laravel-google-cloud-tasks-queue)[![License](https://camo.githubusercontent.com/0d5aa72e8ca6bafc7938bc6b91b652c5d50af6b0f4a8053ae23bfe97e73282d8/68747470733a2f2f706f7365722e707567782e6f72672f737461636b6b69742f6c61726176656c2d676f6f676c652d636c6f75642d7461736b732d71756575652f6c6963656e73652e737667)](https://packagist.org/packages/stackkit/laravel-google-cloud-tasks-queue)

Introduction
============

[](#introduction)

This package allows you to use Google Cloud Tasks as your queue driver.

How it works
============

[](#how-it-works)

Using Cloud Tasks as a Laravel queue driver is fundamentally different than other Laravel queue drivers, like Redis.

Typically a Laravel queue has a worker that listens to incoming jobs using the `queue:work` / `queue:listen` command. With Cloud Tasks, this is not the case. Instead, Cloud Tasks will schedule the job for you and make an HTTP request to your application with the job payload. There is no need to run a `queue:work/listen` command.

For more information on how to configure the Cloud Tasks queue, read the next section [Configuring the queue](#configuring-the-queue)

This package uses the HTTP request handler and doesn't support AppEngine. But feel free to contribute!

Requirements
============

[](#requirements)

This package requires Laravel 5.6 or higher.

Please check the table below for supported Laravel and PHP versions:

Laravel VersionPHP Version5.67.2 or 7.3 or 7.45.77.2 or 7.3 or 7.45.87.2 or 7.3 or 7.46.x7.2 or 7.3 or 7.4 or 8.07.x7.2 or 7.3 or 7.4 or 8.08.x7.3 or 7.4 or 8.0Installation
============

[](#installation)

(1) Require the package using Composer

```
composer require stackkit/laravel-google-cloud-tasks-queue
```

[Official documentation - Creating Cloud Tasks queues](https://cloud.google.com/tasks/docs/creating-queues)

(2) Add a new queue connection to `config/queue.php`

```
'cloudtasks' => [
    'driver' => 'cloudtasks',
    'project' => env('STACKKIT_CLOUD_TASKS_PROJECT', ''),
    'location' => env('STACKKIT_CLOUD_TASKS_LOCATION', ''),
    'handler' => env('STACKKIT_CLOUD_TASKS_HANDLER', ''),
    'queue' => env('STACKKIT_CLOUD_TASKS_QUEUE', 'default'),
    'service_account_email' => env('STACKKIT_CLOUD_TASKS_SERVICE_EMAIL', ''),
],

```

(3) Update the `QUEUE_CONNECTION` environment variable

```
QUEUE_CONNECTION=cloudtasks

```

(4) \[Laravel ^8.0 and above only\] configure failed tasks to use the `database-uuids` driver in `config/queue.php`

```
'failed' => [
    'database' => env('DB_CONNECTION', 'mysql'),
    'table' => 'failed_jobs',
    'driver' => 'database-uuids',
],

```

(5) Create a new Cloud Tasks queue using `gcloud`

```
gcloud tasks queues create [QUEUE_ID]
```

Now that the package is installed, the final step is to set the correct environment variables.

Please check the table below on what the values mean and what their value should be.

Environment variableDescriptionExample`STACKKIT_CLOUD_TASKS_PROJECT`The project your queue belongs to.`my-project``STACKKIT_CLOUD_TASKS_LOCATION`The region where the AppEngine is hosted`europe-west6``STACKKIT_CLOUD_TASKS_HANDLER`The URL that Cloud Tasks will call to process a job. This should be the URL to your Laravel app with the `handle-task` path added`https://.com/handle-task``STACKKIT_CLOUD_TASKS_QUEUE`The queue a job will be added to`emails``STACKKIT_CLOUD_TASKS_SERVICE_EMAIL`The email address of the AppEngine service account. Important, it should have the *Cloud Tasks Enqueuer* role. This is used for securing the handler.`my-service-account@appspot.gserviceaccount.com`Authentication
==============

[](#authentication)

Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable with a path to the credentials file.

More info:

Service Account Roles
---------------------

[](#service-account-roles)

If you're not using your master service account (which have all of the abilities), you must add the following roles to make it works:

1. App Engine Viewer
2. Cloud Tasks Enqueuer
3. Cloud Tasks Viewer
4. Service Account User

Configuring the queue
=====================

[](#configuring-the-queue)

When you first create a queue using `gcloud tasks queues create`, the default settings will look something like this:

```
rateLimits:
  maxBurstSize: 100
  maxConcurrentDispatches: 1000
  maxDispatchesPerSecond: 500.0
retryConfig:
  maxAttempts: 100
  maxBackoff: 3600s
  maxDoublings: 16
  minBackoff: 0.100s

```

Configurable settings
---------------------

[](#configurable-settings)

### maxBurstSize

[](#maxburstsize)

Max burst size limits how fast tasks in queue are processed when many tasks are in the queue and the rate is high.

### maxConcurrentDispatches

[](#maxconcurrentdispatches)

The maximum number of concurrent tasks that Cloud Tasks allows to be dispatched for this queue

### maxDispatchesPerSecond

[](#maxdispatchespersecond)

The maximum rate at which tasks are dispatched from this queue.

### maxAttempts

[](#maxattempts)

Number of attempts per task. Cloud Tasks will attempt the task max\_attempts times (that is, if the first attempt fails, then there will be max\_attempts - 1 retries). Must be &gt;= -1.|

### maxBackoff

[](#maxbackoff)

A task will be scheduled for retry between min\_backoff and max\_backoff duration after it fails

### maxDoublings

[](#maxdoublings)

The time between retries will double max\_doublings times.

A task's retry interval starts at min\_backoff, then doubles max\_doublings times, then increases linearly, and finally retries retries at intervals of max\_backoff up to max\_attempts times.

For example, if min\_backoff is 10s, max\_backoff is 300s, and max\_doublings is 3, then the a task will first be retried in 10s. The retry interval will double three times, and then increase linearly by 2^3 \* 10s. Finally, the task will retry at intervals of max\_backoff until the task has been attempted max\_attempts times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....

Recommended settings for Laravel
--------------------------------

[](#recommended-settings-for-laravel)

To simulate a single `queue:work/queue:listen` process, simply set the `maxConcurrentDispatches` to 1:

```
gcloud tasks queues update [QUEUE_ID] --max-concurrent-dispatches=1

```

More information on configuring queues:

Security
========

[](#security)

The job handler requires each request to have an OpenID token. In the installation step we set the service account email, and with that service account, Cloud Tasks will generate an OpenID token and send it along with the job payload to the handler.

This package verifies that the token is digitally signed by Google. Only Google Tasks will be able to call your handler.

More information about OpenID Connect:

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 85% 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 ~59 days

Recently: every ~50 days

Total

10

Last Release

1621d ago

Major Versions

v1.0.0 → v2.0.02020-10-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f2ce9ecaeb651d64a007c521e37aedaf325aeeb9003a3ba0636d96956e2dc74?d=identicon)[amitartisan](/maintainers/amitartisan)

---

Top Contributors

[![marickvantuil](https://avatars.githubusercontent.com/u/647007?v=4)](https://github.com/marickvantuil "marickvantuil (68 commits)")[![amitartisan](https://avatars.githubusercontent.com/u/75815467?v=4)](https://github.com/amitartisan "amitartisan (6 commits)")[![atrauzzi](https://avatars.githubusercontent.com/u/115199?v=4)](https://github.com/atrauzzi "atrauzzi (2 commits)")[![wildangunawan](https://avatars.githubusercontent.com/u/35158077?v=4)](https://github.com/wildangunawan "wildangunawan (1 commits)")[![illambo](https://avatars.githubusercontent.com/u/1899805?v=4)](https://github.com/illambo "illambo (1 commits)")[![gabfr](https://avatars.githubusercontent.com/u/1237163?v=4)](https://github.com/gabfr "gabfr (1 commits)")[![tommerrett](https://avatars.githubusercontent.com/u/50173333?v=4)](https://github.com/tommerrett "tommerrett (1 commits)")

### Embed Badge

![Health badge](/badges/fleethunttech-laravel-google-cloud-tasks-queue/health.svg)

```
[![Health](https://phpackages.com/badges/fleethunttech-laravel-google-cloud-tasks-queue/health.svg)](https://phpackages.com/packages/fleethunttech-laravel-google-cloud-tasks-queue)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M672](/packages/laravel-socialite)[php-amqplib/php-amqplib

Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.

4.6k125.3M871](/packages/php-amqplib-php-amqplib)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M529](/packages/laravel-passport)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k17](/packages/civicrm-civicrm-core)[stackkit/laravel-google-cloud-tasks-queue

Google Cloud Tasks queue driver for Laravel

84570.1k](/packages/stackkit-laravel-google-cloud-tasks-queue)[packbackbooks/lti-1p3-tool

A library used for building IMS-certified LTI 1.3 tool providers in PHP.

51438.3k2](/packages/packbackbooks-lti-1p3-tool)

PHPackages © 2026

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