New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

richan-fongdasen/laravel-gcr-worker

Google Cloud Run Worker for Laravel
74,317 4
Install
composer require richan-fongdasen/laravel-gcr-worker
Latest Version:1.7.0
PHP:^8.0
Laravel:8 – 12
Older releases:5 · 6 · 7
License:MIT
Last Updated:Mar 24, 2025
Links: GitHub  ·  Packagist
Maintainer: richan-fongdasen

Build codecov Total Downloads Latest Stable Version License: MIT

Laravel GCR Worker

Simple background processing implementation with Google Cloud Run and Google Cloud Pub/Sub

Synopsis

This package would help you to implement any background processing in Laravel like queue worker or scheduled job in Google Cloud Run by handling the triggered HTTP event invocation.

Table of contents

Setup

Install the package via Composer :

$ composer require richan-fongdasen/laravel-gcr-worker

Laravel version compatibility

Laravel version Package version
5.7 - 8.x 1.0 - 1.3
8.x - 11.x ^1.6

Configuration

Publish configuration file using php artisan command

$ php artisan vendor:publish --provider="RichanFongdasen\GCRWorker\ServiceProvider"

The command above would copy a new configuration file to /config/gcr-worker.php

return [

    /*
    |--------------------------------------------------------------------------
    | Allow Event invocation
    |--------------------------------------------------------------------------
    |
    | Specify whether the application would allow and handle any event
    | invocations, such as Pub/Sub topic message published events, Cloud
    | scheduler jobs, etc.
    |
    */

    'allow_event_invocation' => (bool) env('ALLOW_EVENT_INVOCATION', false),


    /*
    |--------------------------------------------------------------------------
    | Maximum Execution Time
    |--------------------------------------------------------------------------
    |
    | Set the max execution time in seconds, the default value is 15 minutes.
    |
    | Warning:
    | This value doesn't update the maximum execution time defined in your
    | nginx, apache or php-fpm configuration. You need to update them manually.
    |
    */

    'max_execution_time' => 60 * 15,


    /*
    |--------------------------------------------------------------------------
    | Middleware
    |--------------------------------------------------------------------------
    |
    | Define the middleware which should be attached in every GCR worker route.
    |
    */

    'middleware' => [
        \Illuminate\Routing\Middleware\SubstituteBindings::class,
        \RichanFongdasen\GCRWorker\Middleware\AllowEventInvocation::class,
    ],


    /*
    |--------------------------------------------------------------------------
    | Path prefix
    |--------------------------------------------------------------------------
    |
    | Define the path prefix of the Pub/Sub event handler url.
    |
    */

    'path_prefix' => 'gcr-worker',
];

Usage

The content for this section is under development.

License

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

Related Packages

imanghafoori/laravel-nullable

A package to help you write expressive defensive code in a functional manner

560,203 151
helgesverre/receipt-scanner

Use OpenAI to extract structured receipt and invoice data from Text, Html, Image...

9,751 145
suitmedia/laravel-cloudflare

Simple and easy cloudflare cache purging in Laravel

9,496 9
leknoppix/laravel-cloudflare

Simple and easy cloudflare cache purging in Laravel

3,427 0
inisiatif/distribution-financings

Share package for distribution financing

1,149 0

Version History

Version Released PHP Laravel License
1.7.0 ^8.0 ^8.0|^9.0|^10.0|^11.0|^12.0 MIT
1.6.0 ^8.0 ^8.0|^9.0|^10.0|^11.0 MIT
1.5.2 ^7.4|^8.0 ^8.0|^9.0|^10.0 MIT
1.5.1 ^7.4|^8.0 ^8.0|^9.0|^10.0 MIT
1.5.0 ^7.4|^8.0 ^8.0|^9.0|^10.0 MIT