PHPackages                             ynizon/gae-support-l58 - 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. ynizon/gae-support-l58

ActiveLibrary

ynizon/gae-support-l58
======================

Google App Engine Support for Laravel 5.8 apps.

1.4.13(6y ago)010MITPHPPHP &gt;=7.1.0

Since Feb 5Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ynizon/GaeSupportL5)[ Packagist](https://packagist.org/packages/ynizon/gae-support-l58)[ RSS](/packages/ynizon-gae-support-l58/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (25)Used By (0)

GaeSupport
==========

[](#gaesupport)

[![Join the chat at https://gitter.im/shpasser/GaeSupportL5](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/shpasser/GaeSupportL5?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Latest Stable Version](https://camo.githubusercontent.com/dbbf4dcfdc2de4682687ba8e3fec97acf0c08e55eb28ae34f1ec9d8aac68c19b/68747470733a2f2f706f7365722e707567782e6f72672f73687061737365722f6761652d737570706f72742d6c352f762f737461626c65)](https://packagist.org/packages/shpasser/gae-support-l5)[![Total Downloads](https://camo.githubusercontent.com/0ae56a9ef9c337eed04ff3e82fb95affe582299153f22bb67d0056a456332492/68747470733a2f2f706f7365722e707567782e6f72672f73687061737365722f6761652d737570706f72742d6c352f646f776e6c6f616473)](https://packagist.org/packages/shpasser/gae-support-l5)[![Latest Unstable Version](https://camo.githubusercontent.com/9804f8d56f797a41558f35a6ecd27cb9150c1a4fde19cc6bbc849a39fd02be30/68747470733a2f2f706f7365722e707567782e6f72672f73687061737365722f6761652d737570706f72742d6c352f762f756e737461626c65)](https://packagist.org/packages/shpasser/gae-support-l5)[![License](https://camo.githubusercontent.com/b0adf301aafcd81c80392bbaeeb3c49a2a6529834dc5d225f6bf461cbedb6c75/68747470733a2f2f706f7365722e707567782e6f72672f73687061737365722f6761652d737570706f72742d6c352f6c6963656e7365)](https://packagist.org/packages/shpasser/gae-support-l5)

Google App Engine(GAE) Support package for Laravel 5.1.

Currently supported features:

- Generation of general configuration files
- Mail service provider
- Queue service provider
- Database connection
- Filesystem

For Lumen see .

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

[](#installation)

Pull in the package via Composer.

```
"require": {
    "shpasser/gae-support-l5": "~1.0"
}
```

Then include the service provider within `config/app.php`.

```
'providers' => [
    Shpasser\GaeSupportL5\GaeSupportServiceProvider::class
];
```

Usage
-----

[](#usage)

Generate the GAE related files/entries.

Command template:

```
php artisan gae:setup --config --cache-config --bucket="your-bucket-id" --db-socket="cloud-sql-instance-socket-connection-string" --db-name="cloud-sql-database-name" --db-host="cloud-sql-instance-ipv4-address" app-id
```

Arguments and Options:

```
php artisan gae:setup [options] [--] app-id

Arguments:
  app-id                     GAE application ID.

Options:
      --config               Generate "app.yaml" and "php.ini" config files.
      --cache-config         Generate cached Laravel config file for use on Google App Engine.
      --bucket=BUCKET        Use the specified GCS-bucket instead of the default one.
      --db-socket=DB-SOCKET  Cloud SQL socket connection string for production environment.
      --db-name=DB-NAME      Cloud SQL database name.
      --db-host=DB-HOST      Cloud SQL database host IPv4 address for local environment.
```

`--cache-config` option generates cached config file for GAE. This option is essential, because cached config file generated by `php artisan config:cache` is not suitable for use on GAE. As well, cached config file generated for GAE probably will not work in local environment. This option should be used to generate cached config file before application is deployed on GAE.

`--bucket` option defines the GCS-bucket ID to be used by the application for storage. Default GCS bucket is configured unless the option is used.

When `--db-name` option is defined at least one of `--db-socket` or `--db-host` should be also defined.

`--db-socket` is set using the following format: `/cloudsql/:`. Where `` is the Cloud SQL instance name and `` is the name of the application it belongs to.

### Mail

[](#mail)

The mail driver configuration can be found in `config/mail.php` and `.env.production`, these configuration files are modified / generated by the artisan command. There is no need in any kind of custom configuration. All the outgoing mail messages are sent with sender address of an administrator of the application, i.e. `admin@your-app-id.appspotmail.com`. The `sender`, `to`, `cc`, `bcc`, `replyTo`, `subject`, `body` and `attachment`parts of email message are supported.

### Queues

[](#queues)

The modified queue configuration file `config/queue.php` should contain:

```
return array(

	...

	/*
	|--------------------------------------------------------------------------
	| GAE Queue Connection
	|--------------------------------------------------------------------------
	|
	*/

	'connections' => array(

		'gae' => array(
			'driver'	=> 'gae',
			'queue'		=> 'default',
			'url'		=> '/tasks',
			'encrypt'	=> true,
		),

		...

	),

);
```

The 'default' queue and encryption are used by default. In order to use the queue your `app/Http/routes.php` file should contain the following route:

```
Route::post('tasks', array('as' => 'tasks',
function()
{
	return Queue::marshal();
}));
```

This route will be used by the GAE queue to push the jobs. Please notice that the route and the GAE Queue Connection 'url' parameter point to the same URL. Since the requests submitted using the route are issued by GAE itself it cannot be CSRF-protected. For more information on the matter please see .

### Cache, Session and Log

[](#cache-session-and-log)

Cache, Session and Log components are supported via the use of specific drivers / handlers:

- Cache - using the 'memcached' driver,
- Session - using the 'memcached' driver,
- Log - using 'syslog' handler.

The configuration options for the mentioned drivers / handlers are generated by the artisan command and can be found in `.env.production` configuration file.

### Database

[](#database)

Google Cloud SQL is supported via Laravel's MySql driver. The connection configuration is added by the artisan command to `config/database.php` under `cloudsql`. The connection parameters can be configured using `--db-socket`, `--db-name` and `--db-host` options via the artisan command.

The database related environment variables are set in `.env.production` and `.env.local` files.

The `production` environment is configured to use the socket connection while the `local` configured to connect via the IPv4 address of the Google Cloud SQL instance. Use Google Developers Console in order to obtain the socket connection string and enable the IPv4 address of your database instance.

The migrations are supported while working in `local` environment only.

To use either the `production` or the `local` environment rename the appropriate file to `.env`.

### Filesystem

[](#filesystem)

In order to support Laravel filesystem on GAE the artisan command modifies `config/filesystem.php`to include an additional disk:

```
'gae' => [
    'driver' => 'gae',
    'root'   => storage_path().'/app',
],
```

and adds the following line to `.env.production` file:

```
FILESYSTEM = gae
```

### Optimizations

[](#optimizations)

The optimizations allow the application to reduce the use of GCS, which is the only read-write storage available on GAE platform as of now.

In order to optimize view compilation the included `cachefs` filesystem can be used to store compiled views using `memcached` service. `cachefs` does not provide the application with a reliable storage solution, information stored using `memcached` is managed according to `memcached` rules and may be deleted when `memcached` decides to. Since the views can be compiled again without any information loss it is appropriate to store compiled views using `cachefs`.

`cachefs` has the following structure:

```
/
+-- bootstrap
    +-- cache
+-- framework
    +-- views
```

'/framework/views' is used to store the compiled views.

Use the following option to enable the feature in `.env.production` and/or `.env.local` file:

```
CACHE_COMPILED_VIEWS = true
```

'/bootstrap/cache' is used to store the `services.json`, `config.php` and `routes.php` files, in order to control caching of these files use the following options in `.env.production` and/or `.env.local` file:

```
CACHE_SERVICES_FILE = true
CACHE_CONFIG_FILE = true
CACHE_ROUTES_FILE = true
```

In order to use `config.php` first generate it using the `--cache-config` option of `php artisan gae:setup` command. `routes.php` has to be generated using `php artisan route:cache` command.

Cache related options are:

- supported on GAE and/or in local environment as long as `memcached` service is present,
- disabled while executing `php artisan gae:setup` command.

Additionally the initialization of GSC bucket can be skipped to boost the performance. In order to do so, set the following option in the `app.yaml` file:

```
env_variables:
        GAE_SKIP_GCS_INIT: true
```

the storage path will be set to `/storage` directory of the GCS bucket and storage directory structure creation will be skipped.

If not used the filesystem initialization can be removed to minimize GCS usage. In order to do so, remove the following line from `.env.production` file:

```
FILESYSTEM = gae
```

### Artisan Console for GAE

[](#artisan-console-for-gae)

To support `artisan` commands while running on GAE the package provides `Artisan Console for GAE`. The console is implemented as a separate service and not enabled by default for security reasons. To use the console securely `/artisan` route has to be protected.

#### Installation

[](#installation-1)

Include the service provider within `config/app.php`.

```
'providers' => [
    Shpasser\GaeSupportL5\GaeArtisanConsoleServiceProvider::class
];
```

Add `/artisan` URL handler to `app.yaml` file.

```
handlers:

        - url: /artisan
          script: public/index.php
          login: admin
          secure: always

        - url: /.*
          script: public/index.php
```

`/artisan` URL handler has to appear before the last one (`url: /.*`), otherwise it will be ignored by GAE. The suggested handler secures the route using GAE URL security options. For more information see [https://cloud.google.com/appengine/docs/php/config/appconfig#PHP\_app\_yaml\_Secure\_URLs](https://cloud.google.com/appengine/docs/php/config/appconfig#PHP_app_yaml_Secure_URLs).

#### Usage

[](#usage-1)

Enter URL  in your browser and use the displayed form to submit `artisan` commands. Since GAE's filesystem is read-only the commands will not be able to perform write / update operations on it. For the same reason migrations have to be prepared on local development environment before the deployment takes place. Since the console is not really interactive all the commands are executed in non-interactive mode(by automatic appending of `-n` option).

Deployment
----------

[](#deployment)

Backup the existing `.env` file if needed and rename the generated `.env.production` to `.env`before deploying your app.

Download and install GAE SDK for PHP and deploy your app.

Known Issues
------------

[](#known-issues)

As of now Laravel scheduled commands are not supported while running on GAE. In order to use `Artisan Console for GAE` the application class `app/Console/Kernel`has be edited and any of the commands scheduled using its `schedule()` function should be removed.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 93.6% 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 ~71 days

Recently: every ~341 days

Total

24

Last Release

2458d ago

Major Versions

1.4.12 → 5.1.x-dev2016-04-09

PHP version history (2 changes)1.0PHP &gt;=5.4.0

1.4.13PHP &gt;=7.1.0

### Community

Maintainers

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

---

Top Contributors

[![shpasser](https://avatars.githubusercontent.com/u/4275204?v=4)](https://github.com/shpasser "shpasser (73 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")[![mgallegos](https://avatars.githubusercontent.com/u/1051369?v=4)](https://github.com/mgallegos "mgallegos (1 commits)")[![takeokunn](https://avatars.githubusercontent.com/u/11222510?v=4)](https://github.com/takeokunn "takeokunn (1 commits)")[![wayneashleyberry](https://avatars.githubusercontent.com/u/727262?v=4)](https://github.com/wayneashleyberry "wayneashleyberry (1 commits)")[![ynizon](https://avatars.githubusercontent.com/u/3251874?v=4)](https://github.com/ynizon "ynizon (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ynizon-gae-support-l58/health.svg)

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

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M186](/packages/spatie-laravel-backup)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M73](/packages/unisharp-laravel-filemanager)[spatie/laravel-db-snapshots

Quickly dump and load databases

1.2k2.8M20](/packages/spatie-laravel-db-snapshots)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/vapor-cli

The Laravel Vapor CLI

31310.7M8](/packages/laravel-vapor-cli)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M368](/packages/laravel-zero-framework)

PHPackages © 2026

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