PHPackages                             agz/laravel-gcp-secret-injector - 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. agz/laravel-gcp-secret-injector

ActiveLibrary

agz/laravel-gcp-secret-injector
===============================

Include GCP secrets in you laravel environment without explicitly declaring them in your .env files

0.0.1(2y ago)19MITPHPPHP ^7.4|^8.0

Since Mar 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/preciousaang/laravel-gcp-secret-injector)[ Packagist](https://packagist.org/packages/agz/laravel-gcp-secret-injector)[ RSS](/packages/agz-laravel-gcp-secret-injector/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Load secrets into your environmental variable without declaring it in your .env
===============================================================================

[](#load-secrets-into-your-environmental-variable-without-declaring-it-in-your-env)

This package helps load sensitive data from you Google Cloud Secret Manager into your laravel environment instead of explictly defining it in your .env file.

Prerequisite
------------

[](#prerequisite)

You need to already have `google/cloud-secret-manager` installed in your project.

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

[](#installation)

You can install this package via composer:

```
composer require agz/laravel-secret-injector

```

To publish the config file run the vendor publish command:

```
php artisan vendor:publish --tag=gcp-secret-injector

```

Configuration
-------------

[](#configuration)

After publishing the secret inject assets, its configuration will be located at config/secret-injector.php. The configuration allows you to configure you environmental variables against the your Google Cloud secrets.

```
return [

    'project_id' => env('GOOGLE_CLOUD_PROJECT'),
    'includedEnvs' => ['production'],
    'secrets' => []
];

```

The `project_id` points to your google cloud project id. The `includedEnvs` tells configures what environments which you want the library to be active. For example, by default is configured to be just production. Meaning that once your APP\_ENV is set to production, then the library will pull secrets from your Google Cloud Secret Manager in to your environment.

The `secrets` is used to configure what environmental variables should point to which secrets.

```
'secrets' => [
        'ENVIROMENTAL_VARIABLE' => 'SECRET_NAME:VERSION',
    ]

```

For example:

```
'secrets' => [
        'APP_KEY' => 'APP_KEY:latest',
        'DB_PASSWORD' => 'DB_PASSWORD:1',
    ]

```

Testing
-------

[](#testing)

```
composer test

```

Contributors
------------

[](#contributors)

- [Precious Ibeagi](https://github.com/preciousaang)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

795d ago

### Community

Maintainers

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

---

Top Contributors

[![preciousaang](https://avatars.githubusercontent.com/u/11736422?v=4)](https://github.com/preciousaang "preciousaang (29 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agz-laravel-gcp-secret-injector/health.svg)

```
[![Health](https://phpackages.com/badges/agz-laravel-gcp-secret-injector/health.svg)](https://phpackages.com/packages/agz-laravel-gcp-secret-injector)
```

PHPackages © 2026

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