tradecoverexchange / google-cloud-tasks-laravel
A Laravel Queue driver to interact with Google Cloud Tasks
Installs: 6 693
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: ^8.1
- google/cloud-tasks: >=1.6
- illuminate/contracts: 9.*
- kevinrob/guzzle-cache-middleware: ^3.3
- tradecoverexchange/google-cloud-jwt-validator: ^1.1
Requires (Dev)
- laravel/legacy-factories: ^1.3
- nunomaduro/collision: ^6.0|^5.0
- nunomaduro/larastan: ^2.0|^1.0
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5.13|^8.3
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-10-26 06:31:48 UTC
README
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 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.