PHPackages                             a1comms/gae-support-laravel - 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. a1comms/gae-support-laravel

Abandoned → [affordablemobiles/g-serverless-support-laravel](/?search=affordablemobiles%2Fg-serverless-support-laravel)Library

a1comms/gae-support-laravel
===========================

Google App Engine Standard Environment runtime support for Laravel apps

v9.0.42(2y ago)337.7k17[1 PRs](https://github.com/affordablemobiles/GaeSupportLaravel/pulls)MITPHPPHP ^8.1CI passing

Since Jun 8Pushed 5mo ago4 watchersCompare

[ Source](https://github.com/affordablemobiles/GaeSupportLaravel)[ Packagist](https://packagist.org/packages/a1comms/gae-support-laravel)[ RSS](/packages/a1comms-gae-support-laravel/feed)WikiDiscussions php8.3-laravel12.x Synced 2d ago

READMEChangelog (10)Dependencies (21)Versions (165)Used By (0)

GServerlessSupportLaravel
=========================

[](#gserverlesssupportlaravel)

 [![Latest Stable Version](https://camo.githubusercontent.com/a23f725b32e15bf8a7ac3c356ed13d4445864ffbec2d0476c3fabe574a63f647/68747470733a2f2f706f7365722e707567782e6f72672f6166666f726461626c656d6f62696c65732f672d7365727665726c6573732d737570706f72742d6c61726176656c2f762f737461626c653f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/a23f725b32e15bf8a7ac3c356ed13d4445864ffbec2d0476c3fabe574a63f647/68747470733a2f2f706f7365722e707567782e6f72672f6166666f726461626c656d6f62696c65732f672d7365727665726c6573732d737570706f72742d6c61726176656c2f762f737461626c653f7374796c653d666f722d7468652d6261646765) [![PHP Version Require](https://camo.githubusercontent.com/ba6a3ece456fa9f7775c4e0b410e4cd764e08102d5587dc4ef5a08a222c1ed96/68747470733a2f2f706f7365722e707567782e6f72672f6166666f726461626c656d6f62696c65732f672d7365727665726c6573732d737570706f72742d6c61726176656c2f726571756972652f7068703f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/ba6a3ece456fa9f7775c4e0b410e4cd764e08102d5587dc4ef5a08a222c1ed96/68747470733a2f2f706f7365722e707567782e6f72672f6166666f726461626c656d6f62696c65732f672d7365727665726c6573732d737570706f72742d6c61726176656c2f726571756972652f7068703f7374796c653d666f722d7468652d6261646765) [![Monthly Downloads](https://camo.githubusercontent.com/8103924dc625f4edc6b6a517bb867eae7d97153910d9038e5abfaad7185c0b90/68747470733a2f2f706f7365722e707567782e6f72672f6166666f726461626c656d6f62696c65732f672d7365727665726c6573732d737570706f72742d6c61726176656c2f642f6d6f6e74686c793f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/8103924dc625f4edc6b6a517bb867eae7d97153910d9038e5abfaad7185c0b90/68747470733a2f2f706f7365722e707567782e6f72672f6166666f726461626c656d6f62696c65732f672d7365727665726c6573732d737570706f72742d6c61726176656c2f642f6d6f6e74686c793f7374796c653d666f722d7468652d6261646765) [![Total Downloads](https://camo.githubusercontent.com/ba66879c656752a5aa9f173974d274de7a64ecffb211536d7de4a74e2667f917/68747470733a2f2f706f7365722e707567782e6f72672f6166666f726461626c656d6f62696c65732f672d7365727665726c6573732d737570706f72742d6c61726176656c2f646f776e6c6f6164733f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/ba66879c656752a5aa9f173974d274de7a64ecffb211536d7de4a74e2667f917/68747470733a2f2f706f7365722e707567782e6f72672f6166666f726461626c656d6f62696c65732f672d7365727665726c6573732d737570706f72742d6c61726176656c2f646f776e6c6f6164733f7374796c653d666f722d7468652d6261646765) [![License](https://camo.githubusercontent.com/2556a0c84520ab33fb7c51e6d6e36e6fc37eaff5f296a811c0a2cdce9fd54b75/68747470733a2f2f706f7365722e707567782e6f72672f6166666f726461626c656d6f62696c65732f672d7365727665726c6573732d737570706f72742d6c61726176656c2f6c6963656e73653f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/2556a0c84520ab33fb7c51e6d6e36e6fc37eaff5f296a811c0a2cdce9fd54b75/68747470733a2f2f706f7365722e707567782e6f72672f6166666f726461626c656d6f62696c65732f672d7365727665726c6573732d737570706f72742d6c61726176656c2f6c6963656e73653f7374796c653d666f722d7468652d6261646765)

 [![Google App Engine](docs/images/icons/app-engine.png)](docs/images/icons/app-engine.png) [![Google Cloud Run](docs/images/icons/cloud-run.png)](docs/images/icons/cloud-run.png) [![Google Operations Suite](docs/images/icons/operations-suite.png)](docs/images/icons/operations-suite.png)

Google Serverless runtime support package for **Laravel 12.x**.

Supporting Cloud Run &amp; App Engine (Standard Environment) with the `php83` runtime.

Based on original work for App Engine ([GaeSupportL5](https://github.com/shpasser/GaeSupportL5) using the `php55` runtime) by [@shpasser](https://github.com/shpasser).

Functionality
-------------

[](#functionality)

- **Google Cloud Operations Suite** integration
    - **Cloud Logging** destination with structured logs (see [docs/logging.md](docs/logging.md)).
    - **Error Reporting** integration for aggregation of reported exceptions (see [docs/logging.md](docs/logging.md#error-reporting)).
        - **Client Side JavaScript Error** ingestion (see [docs/client-side-error-report.md](docs/client-side-error-reporting.md)).
    - **Cloud Trace** (via [opentelemetry](https://github.com/open-telemetry/opentelemetry-php)) (see [docs/trace.md](docs/trace.md))
        - Distributed trace propagation via [Guzzle](src/AffordableMobiles/GServerlessSupportLaravel/Trace/Instrumentation/Guzzle/GuzzleInstrumentation.php#L70).
        - Integration with [laravel-debugbar](https://github.com/barryvdh/laravel-debugbar) (optional, see [docs/debugbar.md](docs/debugbar.md)).
- **Identity Aware Proxy (IAP)** integration
    - **Inbound authentication** via Laravel's Guards (optional, see [docs/iap-auth-verify.md](docs/iap-auth-verify.md)).
    - **Outbound authentication** via Guzzle middleware (optional, see [docs/guzzle.md](docs/guzzle.md#authtokenmiddleware)).
- **Cloud SQL** integration
    - **IAM Authentication** (optional, see [docs/cloud-sql.md](docs/cloud-sql.md#iam-authentication)).
    - Automatic failover between read replicas (optional, see [docs/cloud-sql.md](docs/cloud-sql.md#multiple-read-replicas)).
    - **Query Insights** integration via [eloquent-sqlcommenter](https://github.com/affordablemobiles/eloquent-sqlcommenter) (optional, see [docs/cloud-sql.md](docs/cloud-sql.md#query-insights)).
- **Cloud Firestore in Datastore mode** integration
    - **Session handler** (optional, see [docs/sessions.md](docs/sessions.md)).
    - **Eloquent driver** via [eloquent-datastore](https://github.com/affordablemobiles/eloquent-datastore).
- Optimizations for containerized deployment
    - `bootstrap/cache` generation before deployment (see [g-serverless:prepare](src/AffordableMobiles/GServerlessSupportLaravel/Console/GServerlessPrepareCommand.php)).
    - Blade View Pre-Compiler (optional, see [docs/blade-pre-compile.md](docs/blade-pre-compile.md))
    - Automatic retries for outbound connections on network layer failure with Guzzle (optional, see [docs/guzzle.md](docs/guzzle.md#guzzleretrymiddleware))
- [Domain Wide Delegation (DWD)](src/AffordableMobiles/GServerlessSupportLaravel/Integration/Google/Credentials/GCEDWDCredentials.php#L12) support via [IAM Credentials API](https://cloud.google.com/iam/docs/reference/credentials/rest) (no key file required).
- [IAMSigner](src/AffordableMobiles/GServerlessSupportLaravel/Integration/JWT/Signer/IAMSigner.php) for [lcobucci/jwt](https://github.com/lcobucci/jwt) using [IAM Credentials API](https://cloud.google.com/iam/docs/reference/credentials/rest).
- Examples for push-to-deploy from Git via Cloud Build with Secret Manager (see [docs/cloudbuild.md](docs/cloudbuild.md))

Installation
------------

[](#installation)

**1.** Pull in the package via Composer:

```
    "require": {
        "affordablemobiles/g-serverless-support-laravel": "~12"
    }
```

**2.** Add the following to `composer.json`:

```
    "scripts": {
        "post-autoload-dump": [
            "php artisan g-serverless:prepare"
        ]
    },
```

This is to automatically run the artisan command that prepares our app for deployment after composer finishes running: this creates any necessary cache files and if enabled, pre-compiles all of the blade views.

If you are deploying with Cloud Build, `composer install` is likely to run just before packaging/deployment to your chosen serverless product, so this will ensure everything else required runs as part of that step.

**3.** Update the `use` statement at the top of `bootstrap/app.php` from:

```
use Illuminate\Foundation\Application;
```

to:

```
use AffordableMobiles\GServerlessSupportLaravel\Foundation\Application;
```

This will enable automatic exception reporting to Cloud Logging &amp; Error Reporting, alongside adjusting the emergency logger to work correctly inside the containerized environment by writing to `stderr`.

**Important:** the Logging API &amp; the Trace API need to be enabled within your project, and the service account being used by your serverless app needs to have IAM permissions to use them:

- [Enable the Logs API](https://console.cloud.google.com/apis/api/logging.googleapis.com/overview) - *append `?project=` to the URL if necessary.*
- Assign the IAM permission "Logs Writer" to your service account.
- [Enable the Trace API](https://console.cloud.google.com/apis/api/cloudtrace.googleapis.com/overview) - *append `?project=` to the URL if necessary.*
- Assign the IAM permission "Cloud Trace Agent" to your service account.

**4.** Configure the service providers within `config/app.php` by adding:

```
    /*
    |--------------------------------------------------------------------------
    | Autoloaded Service Providers
    |--------------------------------------------------------------------------
    |
    | The service providers listed here will be automatically loaded on any
    | requests to your application. You may add your own services to the
    | arrays below to provide additional features to this application.
    |
    */

    'providers' => \Illuminate\Support\ServiceProvider::defaultProviders()->merge([
        // Package Service Providers...
        \AffordableMobiles\GServerlessSupportLaravel\GServerlessSupportServiceProvider::class,
        \AffordableMobiles\GServerlessSupportLaravel\Auth\AuthServiceProvider::class,
        \AffordableMobiles\GServerlessSupportLaravel\Database\DatabaseServiceProvider::class,
    ])->replace([
        \Illuminate\View\ViewServiceProvider::class => \AffordableMobiles\GServerlessSupportLaravel\View\ViewServiceProvider::class,
    ])->toArray(),
```

**5.** Add the following environment variables:

*This can be done either in `.env`, inside `app.yaml`, or as part of the Cloud Run service configuration - we recommend the latter two options where possible.*

```
LOG_CHANNEL=stderr
LOG_STDERR_FORMATTER=AffordableMobiles\GServerlessSupportLaravel\Log\Formatter\JsonFormatter

CACHE_STORE=array

SESSION_DRIVER=datastore

```

When using Cloud Tasks, you'll also want to configure:

```
CLOUD_TASKS_REGION=europe-west1 (or similar, required)
TASK_QUEUE_SERVICE_ACCOUNT=@appspot.gserviceaccount.com (default, required for Cloud Run)
OIDC_AUDIENCE= (required for Cloud Run)

```

If you are using an external CDN such as Cloudflare, also configure the following environment variable with the name of the HTTP header used for passing the client's IP address:

```
SOURCE_IP_HEADER=CF-Connecting-IP

```

And if you need to disable OpenTelemetry tracing (we highly recommend you leave it enabled), define the following environment variable:

```
G_SERVERLESS_TRACE_STOP=true

```

Also, if running in a development environment, please also set the following:

```
G_SERVERLESS_DEVELOPMENT=true

```

This does several things, such as:

- Alters the local storage location to include `HTTP_HOST`.
- Turns OpenTelemetry tracing on for every request.
- Turns off sticky database connections per instance.

Upgrading (from Laravel 11.x LTS)
---------------------------------

[](#upgrading-from-laravel-11x-lts)

**1.** Update the package version in `composer.json`:

```
    "require": {
        "affordablemobiles/g-serverless-support-laravel": "~12"
    }
```

**2.** Follow the Laravel upgrade steps for all versions 11.x ... 12.x

###  Health Score

52

↑

FairBetter than 96% of packages

Maintenance49

Moderate activity, may be stable

Popularity32

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity90

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 92.8% 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 ~15 days

Recently: every ~72 days

Total

159

Last Release

891d ago

Major Versions

v6.0.36 → v9.0.32022-03-31

v6.0.37 → v9.0.42022-04-04

v6.0.38 → v9.0.252022-08-04

v6.0.39 → v9.0.262022-08-04

v6.0.41 → v9.0.402023-09-13

PHP version history (4 changes)5.1.0PHP &gt;=5.5.9

v5.5.7PHP &gt;=7.2.0

v5.5.41PHP ^7.2

v9.0.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7f82764dbcd478679a400621c6a94ca45c6a4bad04bd6aae24fe4a68eabb68c?d=identicon)[iamacarpet](/maintainers/iamacarpet)

---

Top Contributors

[![iamacarpet](https://avatars.githubusercontent.com/u/1333857?v=4)](https://github.com/iamacarpet "iamacarpet (591 commits)")[![mhiran](https://avatars.githubusercontent.com/u/64256097?v=4)](https://github.com/mhiran "mhiran (22 commits)")[![matthewnessworthy](https://avatars.githubusercontent.com/u/5653887?v=4)](https://github.com/matthewnessworthy "matthewnessworthy (13 commits)")[![dstretton](https://avatars.githubusercontent.com/u/25366394?v=4)](https://github.com/dstretton "dstretton (9 commits)")[![flexgrip](https://avatars.githubusercontent.com/u/141172?v=4)](https://github.com/flexgrip "flexgrip (1 commits)")[![Lew-Blount](https://avatars.githubusercontent.com/u/15653280?v=4)](https://github.com/Lew-Blount "Lew-Blount (1 commits)")

---

Tags

appengineappengine-phpcloud-rungaegcrgoogle-appenginegoogle-cloudgoogle-cloud-runlaravelphp

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/a1comms-gae-support-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/a1comms-gae-support-laravel/health.svg)](https://phpackages.com/packages/a1comms-gae-support-laravel)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

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