tradecoverexchange/google-cloud-tasks-laravel

A Laravel Queue driver to interact with Google Cloud Tasks
7,090 2
Install
composer require tradecoverexchange/google-cloud-tasks-laravel
Latest Version:v0.5.0
PHP:^7.3|^8.0
Laravel:8 · 9
Older releases:7
License:MIT
Last Updated:Jan 26, 2023
Links: GitHub  ·  Packagist
Maintainer: tradecoverexchange

Google Cloud Tasks Queue Driver for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel Queue driver to interact with Google Cloud Tasks.

Installation

Requires Laravel 9 and PHP 8.1 as a minimum.

You can install the package via composer:

composer require tradecoverexchange/google-cloud-tasks-laravel

You can publish an overriding queue config file with:

php artisan vendor:publish --provider="TradeCoverExchange\GoogleCloudTaskLaravel\CloudTaskServiceProvider" --tag cloud-task-config --force

Or you can manually add the two following connections to your own queues.php config file:

return [
    'connections' => [
        'app_engine_tasks' => [
            'driver' => 'google_app_engine_cloud_tasks',
            'queue' => env('GOOGLE_CLOUD_TASKS_QUEUE', 'default'),
            'project_id' => env('GOOGLE_CLOUD_TASKS_PROJECT_ID', ''),
            'location' => env('GOOGLE_CLOUD_TASKS_LOCATION_ID', ''),
            'options' => [
                'credentials' => 'path/to/your/keyfile',
                'transport' => 'rest',
            ],
        ],

        'http_cloud_tasks' => [
            'driver' => 'google_http_cloud_tasks',
            'queue' => env('GOOGLE_CLOUD_TASKS_QUEUE', 'default'),
            'project_id' => env('GOOGLE_CLOUD_TASKS_PROJECT_ID', ''),
            'location' => env('GOOGLE_CLOUD_TASKS_LOCATION_ID', ''),
            'authentication' => [
                'token_type' => 'oidc',
                'service_account' => env('GOOGLE_CLOUD_TASKS_SERVICE_ACCOUNT', ''),
            ],
            'options' => [
                'credentials' => 'path/to/your/keyfile',
                'transport' => 'rest',
            ],
        ],
    ],
];

Usage

Usage of the package should primarily be done via the Laravel Queue system.

Missing Features

There is no ability to configure the worker options in the same way as a typical queue connection in Laravel.

For Http Tasks only the OIDC token type has been implemented for protecting the controller from fraudulent requests. We don't use OAuth ourselves but would be happy to include if someone makes a PR for it or knows how that mechanism should work compared to OIDC.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

About Us

Trade Cover Exchange

Trade Cover Exchange is a platform for insuring your trade with other companies, protecting you from instabilities in the supply chain.

We proudly use the Google Cloud platform for our service and hope to share more of our work with the developer community in the future.

Security

If you discover any security related issues, please email peter@tradecoverexchange.com instead of using the issue tracker.

Credits

License

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

Related Packages

ylsideas/google-cloud-scheduler-laravel

A Laravel Package to execute commands based on the Scheduler

5,716 0
firevel/firestore

Firestore wrapper for Laravel app running inside Google App Engine.

21,744 6
firevel/firequent

Limited implementation of Eloquent based on Firestore.

7,142 26
beyounglabs/monolog-stackdriver

Stackdriver handler for Monolog (codeinternetapplications/monolog-stackdriver Fo...

2,179 0

Version History

Version Released PHP Laravel License
v0.5.0 ^7.3|^8.0 9.*|8.* MIT
0.4.0 ^7.3|^8.0 8.* MIT
v0.3.0 ^7.3 8.* MIT
v0.2.0 ^7.3 8.* MIT
v0.1.0 ^7.3 ^7.0 MIT
Pre-releases (1)
Version Released PHP Laravel License
v1.0.0-alpha ^8.1 9.* MIT