PHPackages                             ipaas/gapp-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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. ipaas/gapp-laravel

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

ipaas/gapp-laravel
==================

\[DEPRECATED\] IPaaS package for laravel provides php support for google app-engine logging and handling - This package is no longer maintained

v4.1.0(10mo ago)05.2k3CC-BY-NC-ND-4.0PHPPHP &gt;=7.2CI failing

Since Apr 17Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/iinaveedahmed/gapp-laravel)[ Packagist](https://packagist.org/packages/ipaas/gapp-laravel)[ Docs](https://5andhalf.com/)[ RSS](/packages/ipaas-gapp-laravel/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (8)Dependencies (7)Versions (18)Used By (0)

⚠️ NOTICE: This package is no longer maintained and is outdated
===============================================================

[](#️-notice-this-package-is-no-longer-maintained-and-is-outdated)

This package is deprecated and no longer receives updates or support. Please consider using alternative solutions for Google App Engine integration with Laravel.

iPaaS package for Laravel
=========================

[](#ipaas-package-for-laravel)

This package includes

- Driver for Google stack logging
- Exception handler for Google error reporting
- Log-info (`iLog`) helper
    - To collect info on runtime through laravel service container interface
    - To render collected info and attach to each log context
- Middleware
    - To authenticate request
    - To capture initial request for logger
- Request
    - To provide additional methods with request
- Exceptions
    - To report exception with Log-info context
    - To render exception according to *iPaaS* set standards
- Response
    - To all context information with response
    - To render error and response according to *iPaaS* set standards
- Other helpers
    - Converter
    - \[more coming soon\]

Setup
=====

[](#setup)

### i. Add Package

[](#i-add-package)

Run composer update after adding composer package

```
ipaas/gapp-laravel: ~1.1.0
```

**OR;** by running

```
composer require ipaas/gapp-laravel // considering v2+
```

Make sure that the
**ENV:** GAPP\_SECURE is set to `true`; and
**ENV:** LOG\_CHANNEL on gcloud environment is set to `stack-driver`;

### ii. Migration and Artisan Command

[](#ii-migration-and-artisan-command)

If you are using the version 2.0 or later, you will have access to the migration and artisan command:

`php artisan vendor:publish --tag=gapp` command will push the middleware to the application, and furthermore using `GAPP_SECURE` set to `true`, the security will be applied.

`php artisan migrate` command will create a new `partner_apps` table in your application, which will be used to verify the `X-Api-Key` when passing the middleware `partner`.

`php artisan create-partner-app {provider}` command will create a new row in your new `partner_apps` table with a provider name as optional argument.

API Documentation
=================

[](#api--documentation)

Log-info (ilog)
---------------

[](#log-info-ilog)

Helper to add context information to all log entries.

> Once context is added to ilog it will append to all future logs entries ilog refresh with each request and; have same life cycle as of request()

`ilog()` is a helper method returning singleton class `Ipaas\Gapp\Logger\Client.php`To add context info just call `ilog()` and chain any method available. Following methods are available:

MethodUsage`setClientId (string)`set client id/name`setClientKey (string)`set client key/token`setRequestId (string)`set request id/token`setType (string)`type of request`prop ((string)value, (string)name)`any custom key and value`setDate ((string⎮Carbon)value, (string)name)`any custom date key and value`setDateFrom (string⎮Carbon)`sync/request date from`setDateTo (string⎮Carbon)`sync/request date to`setUuid (string⎮null)`universal unique identifier`toArray()`get all info as array> `iLog([data-set])` can be use to re-init\* log data. *\*can be use to pass log-info to queue jobs*

**Example**Following example will write log in GCloud Logging with all provided context

```
/* ------ Class A ------- */
function validateUser(Request $request){
	// validate request
	$request->validate(['user_id'=>'integer|required']);

	// get user details
	$user = User::get($data->user_id);

	if ($user) {

		/********LOG-INFO PROVIDER*******/
		iLog()                          // add user details to context
		->setClientId($user->id)        // client id to context
		->setClientKey($user->key);     // client key to context

		// add request details context
		iLog()->setType('Validate user name');

		// Calling other class to resolve request
		return ClassB::validateUserName($user);
	}
}

/* ------ Class B ------- */
// all set context still exist
function validateUserName(User $user){
	// log event info
	// will be logged with context
	Log::info('Validating user name')

	// validate user name
	$name = $user->name;
	if(empty($name) || is_null($name))
	{
		// log warning that name is not valid
		// will be logged all context
		Log::warning('Name is null or empty');
		return false;
	}
}
```

Middleware
----------

[](#middleware)

### Validation

[](#validation)

By default this library try to validate request by checking headers:

- X-Api-Key (set on the `partner_apps` table) the system will try to match the header `X-Api-Key` with the `partner_apps` table. *To enable*, just add the middleware `partner` on your desirable route `Route::get('foo', FooController@bar)->middleware('partner')`

### Logging

[](#logging)

By default library try to translate and log following details:

```
$request->header('Authorization')       // Authorization value from header
$request->header('X-Api-Key')           // Client ID from header
$request->header('Gapp-Request-ID')    // Gapp Request ID from header
$request->uuid                          // request uuid
$request->dateFrom                      // date from
$request->dateTo                        // date to
```

Request
-------

[](#request)

Request is resolved using `Ipass/Request` controller to use see the given example:

```
use Ipaas\Gapp\Request;
use Ipass\Response;
class Accounts extends Response;
{
	public function index(Request $request)
	{
	  $rules = ['name' => 'required|string'];
	  $request->validate($rules);
	}
}
```

all given function are chain-able when extend method is used

```
        $request
            ->boolify('EnablePaymentsToAccount')
            ->arrify('Type')
            ->validate($rules);
```

**Validate**Validate request based on given rules set.

```
// $rules is laravel validation rule set
Func: validate(array $rules)

Return: REQUEST if all sucessfull
Throw: Unprocessable Entity (422) if validation fails
```

**Arrify**Convert request csv parameter to php array.

```
// $item is request csv param
Func: arrify(string $item)

Return: modified REQUEST
```

**Boolify**Convert request string 'true/false' parameter to php boolean.

```
// $item is request string 'true/false'
Func: boolify(string $item)

Return: modified REQUEST
```

**Requestify**Replace request given parameter value.

```
// $item is request parameter name
// $value is new value
Func: requestify(string $item, mixed $value)

Return: modified REQUEST
```

Response
--------

[](#response)

> Response helper `iresponse`or use by extending base controller `[YOUR CONTROLLER] extends Ipaas/Response.php`, with that helper you can access sendError() method too, making an exception easier.

**Set Meta**Chain-able function to set response meta data

```
return $this->meta(['client_id' => 'unknown'])->sendResponse($data);
```

**Set header**Chain-able function to set response header data

```
return $this->header(['content-type' => 'application/json'])->sendResponse($data);
```

Other Helpers
-------------

[](#other-helpers)

### Converter

[](#converter)

> Ipaas/Helper/Converter-Helpers

**Normalized Name**Replace ASCII space unicode with ` ` space.

Input: `te \n sting`

Response: `te sting`

```
// $name is unicode string
Func: normalizedName(string $name)

Return: normalized string
```

**Boolify List**Convert given string 'true/false' parameter to php boolean in provided array.

Input: `['true', 'false', 'TRUE', 'FALSE', true, false, TRUE, FALSE, 0, 1, '0', '1', '', ' test']`

Response: `[true, false, true, false, true, false, true, false, false, true, false, true, false, true]`

```
// $list is haystack array
// $item is needle name
Func: boolifyList(array $list, string $item)

Return: modified list
```

Note
----

[](#note)

*ps. google/cloud package is required to run application on google app engine flex environment*

Troubleshooting - Upgrade v1.\* to v2.\*
----------------------------------------

[](#troubleshooting---upgrade-v1-to-v2)

- `ilog()->data()` was changed to `ilog()->appendData()`;
- `iresponse()` method was removed, use `Ipaas\Gapp\Response()` instead;
- you do not need to instance the provider `Ipaas\IpaasServiceProvider::class` anymore, it is now automatically injected by composer;
- `stackdriver` logging channel was changed to `stack-driver`
- all the `ilog()` setters were changed too:
    - client is now setClientId;
    - key is now setClientKey;
    - type is now setType;
    - dateFrom is now setDateFrom;
    - dateTo is now setDateTo;
    - uuid is now setUuid;
- all the exception helpers were removed:
    - iThrow;
    - UnauthorizedException;
    - BadRequestException;
    - TooManyRequestException;
    - NotFoundException;
    - InternalServerException;
- all the response helpers were removed:
    - errorValidation;
    - errorUnauthorized;
    - errorBadRequest;
    - errorTooManyRequest;
    - errorNotFound;
    - errorNotImplemented;
    - errorInternalServer;

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance54

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 85.2% 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 ~191 days

Recently: every ~429 days

Total

15

Last Release

312d ago

Major Versions

v1.2.0 → v2.0.02020-12-04

v2.0.0 → v3.0.02020-12-04

v3.0.0 → v4.0.02020-12-04

PHP version history (2 changes)v1.1.0PHP ^7.1.3

v2.0.0PHP &gt;=7.2

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/57c7e9eb12a190641808bf0f522ae797e6477ff682838798b327424ef81aa986?d=identicon)[james5andhalf](/maintainers/james5andhalf)

---

Top Contributors

[![iinaveedahmed](https://avatars.githubusercontent.com/u/7380838?v=4)](https://github.com/iinaveedahmed "iinaveedahmed (46 commits)")[![kromacie](https://avatars.githubusercontent.com/u/39908514?v=4)](https://github.com/kromacie "kromacie (5 commits)")[![tiaguinhor](https://avatars.githubusercontent.com/u/9930297?v=4)](https://github.com/tiaguinhor "tiaguinhor (3 commits)")

---

Tags

google-appenginegoogle-cloud-platformlaravel-5-packagephp72

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ipaas-gapp-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/ipaas-gapp-laravel/health.svg)](https://phpackages.com/packages/ipaas-gapp-laravel)
```

###  Alternatives

[open-telemetry/opentelemetry-auto-laravel

OpenTelemetry auto-instrumentation for Laravel

582.4M8](/packages/open-telemetry-opentelemetry-auto-laravel)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135212.4k7](/packages/statamic-rad-pack-runway)[google/cloud-error-reporting

Stackdriver Error Reporting Client for PHP

204.3M27](/packages/google-cloud-error-reporting)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14844.4k1](/packages/guanguans-laravel-exception-notify)

PHPackages © 2026

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