A Laravel Queue driver to interact with Google Cloud Tasks.
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 of the package should primarily be done via the Laravel Queue system.
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.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
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.
If you discover any security related issues, please email peter@tradecoverexchange.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.