PHPackages                             platformsh/laravel-bridge - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. platformsh/laravel-bridge

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

platformsh/laravel-bridge
=========================

Bridge library for running Symfony Flex on Platform.sh

2.2.2(2y ago)8292.2k↓20.2%17[4 issues](https://github.com/platformsh/laravel-bridge/issues)[2 PRs](https://github.com/platformsh/laravel-bridge/pulls)MITPHPPHP &gt;=7.2CI failing

Since Jun 21Pushed 5mo ago13 watchersCompare

[ Source](https://github.com/platformsh/laravel-bridge)[ Packagist](https://packagist.org/packages/platformsh/laravel-bridge)[ RSS](/packages/platformsh-laravel-bridge/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (12)Used By (0)

Laravel bridge for Platform.sh
==============================

[](#laravel-bridge-for-platformsh)

This simple bridge library connects a Laravel-based application to [Platform.sh](https://platform.sh/). In the typical case it should be completely fire-and-forget.

Laravel prefers all configuration to come in through environment variables with specific names in a specific format. Platform.sh provides configuration information as environment variables in a different specific format. This library handles mapping the Platform.sh variables to the format Laravel expects for common values.

Usage
-----

[](#usage)

Simply require this package using Composer. When Composer's autoload is included this library will be activated and the environment variables set. As long as that happens before Laravel bootstraps its configuration (which it almost certainly will) everything should work fine with no further user-interaction necessary.

```
composer require platformsh/laravel-bridge

```

Note make sure to clear the cache on relevant platform.sh environments after updating this package.

```
php artisan cache:clear

```

Mappings performed
------------------

[](#mappings-performed)

- If a Platform.sh relationship named `database` is defined, it will be taken as an SQL database and mapped to the `DB_*` environment variables for Laravel.
- If a Platform.sh relationship named `rediscache` is defined, it will be mapped to the `REDIS_*` environment variables for Laravel. Additionally, the `CACHE_DRIVER` (up to Laravel v10) and `CACHE_STORE` (Laravel v11+) variables will be set to `redis` to activate it automatically.
- If a Platform.sh relationship named `redissession` is defined, the `SESSION_DRIVER` will be set to `redis` and the `REDIS_*` variables set based on that relationship. NOTE: This means you **must** set 2 relationships to the same Redis service and endpoint, as Laravel reuses the same backend connection.
- The Laravel `APP_KEY` is set based on the `PLATFORM_PROJECT_ENTROPY` variable, which is provided for exactly this purpose.
- The Laravel `APP_URL` variable is set based on the current route if possible.
- The `SESSION_SECURE_COOKIE` variable is set to true if it's not already defined. A Platform.sh environment is by default encrypted-always, so there's no reason to allow unencrypted cookies. This can be overridden by setting the Platform.sh variable `env:SESSION_SECURE_COOKIE` to 0.
- The `MAIL_DRIVER`, `MAIL_HOST`, and `MAIL_PORT` variables are set to support sending email through the Platform.sh mail gateway. The `MAIL_ENCRYPTION` value is also set to `0` to disable TLS, as it is not needed or supported within Platform.sh's network. Note, however, that doing so is only supported on Laravel 6.0.4 and later. On earlier versions you *must* manually modify `mail.php` and set `encryption` to `null`:

```
    'encryption' => null,

```

Common environment variables not set
------------------------------------

[](#common-environment-variables-not-set)

Laravel provides reasonable defaults for many environment variables already and this library does not override those. They may, however, be customized by setting a Platform.sh variable named `env:ENV_NAME`. (Note the `env:` prefix.) The most likely variables to override are listed below for convenience:

- `env:APP_NAME`: The human-friendly name of the application.
- `env:APP_ENV`: Whether the application is in `production` or `development` mode.
- `env:APP_DEBUG`: Set true to enable verbose error messages.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 51% 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 ~222 days

Recently: every ~387 days

Total

10

Last Release

888d ago

Major Versions

1.1 → 2.0.02019-03-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1465106?v=4)[Patrick Dawkins](/maintainers/pjcdawkins)[@pjcdawkins](https://github.com/pjcdawkins)

---

Top Contributors

[![Crell](https://avatars.githubusercontent.com/u/254863?v=4)](https://github.com/Crell "Crell (25 commits)")[![chadwcarlson](https://avatars.githubusercontent.com/u/5473659?v=4)](https://github.com/chadwcarlson "chadwcarlson (7 commits)")[![lsmith77](https://avatars.githubusercontent.com/u/300279?v=4)](https://github.com/lsmith77 "lsmith77 (6 commits)")[![damz](https://avatars.githubusercontent.com/u/110678?v=4)](https://github.com/damz "damz (4 commits)")[![chady](https://avatars.githubusercontent.com/u/467474?v=4)](https://github.com/chady "chady (3 commits)")[![gilzow](https://avatars.githubusercontent.com/u/2332956?v=4)](https://github.com/gilzow "gilzow (2 commits)")[![matthiaz](https://avatars.githubusercontent.com/u/3532563?v=4)](https://github.com/matthiaz "matthiaz (1 commits)")[![thomasdiluccio](https://avatars.githubusercontent.com/u/3739767?v=4)](https://github.com/thomasdiluccio "thomasdiluccio (1 commits)")

---

Tags

laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/platformsh-laravel-bridge/health.svg)

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

PHPackages © 2026

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