PHPackages                             stechstudio/laravel-infisical - 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. stechstudio/laravel-infisical

ActiveLibrary

stechstudio/laravel-infisical
=============================

Import your Infisical applications secrets as Laravel environment variables.

0.2(7mo ago)1502—0%2[1 issues](https://github.com/stechstudio/laravel-infisical/issues)MITPHPPHP ^8.3

Since Aug 15Pushed 7mo agoCompare

[ Source](https://github.com/stechstudio/laravel-infisical)[ Packagist](https://packagist.org/packages/stechstudio/laravel-infisical)[ RSS](/packages/stechstudio-laravel-infisical/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (13)Versions (3)Used By (0)

[![infisical-banner](https://private-user-images.githubusercontent.com/203749/478286390-90534b28-65ff-4376-87fc-679d04161de3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQxNjE1OTgsIm5iZiI6MTc3NDE2MTI5OCwicGF0aCI6Ii8yMDM3NDkvNDc4Mjg2MzkwLTkwNTM0YjI4LTY1ZmYtNDM3Ni04N2ZjLTY3OWQwNDE2MWRlMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMyMlQwNjM0NThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wNjFmOTgxNDkxYTYwMzI5MmVhZjIwMjcxZDhjYmQxMzkxNWVkNmIwOTgxMjRkMDZlMDQ3NzY4ZjNmZjBkOGQ2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.-koJpmtmIHUkGpjzr1bayyEpnFG__czltcFcR3upuJE)](https://private-user-images.githubusercontent.com/203749/478286390-90534b28-65ff-4376-87fc-679d04161de3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQxNjE1OTgsIm5iZiI6MTc3NDE2MTI5OCwicGF0aCI6Ii8yMDM3NDkvNDc4Mjg2MzkwLTkwNTM0YjI4LTY1ZmYtNDM3Ni04N2ZjLTY3OWQwNDE2MWRlMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMyMlQwNjM0NThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wNjFmOTgxNDkxYTYwMzI5MmVhZjIwMjcxZDhjYmQxMzkxNWVkNmIwOTgxMjRkMDZlMDQ3NzY4ZjNmZjBkOGQ2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.-koJpmtmIHUkGpjzr1bayyEpnFG__czltcFcR3upuJE)[![Latest Version on Packagist](https://camo.githubusercontent.com/f8f6c6108d066746d10c6d77e68d1040c56849cbdf76b22cdb5cca405d116cf6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737465636873747564696f2f6c61726176656c2d696e6669736963616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stechstudio/laravel-infisical)

[Infisical](https://infisical.com/) is an all-in-one platform to securely manage application secrets and share them with your team. This package integrates Infisical with Laravel, exporting secrets as environment variables.

- Leverages the [Infisical CLI](https://docs.infisical.com/cli/installation) to fetch and export secrets.
- Merges secrets onto your base `.env` file (optional).
- Provides an Artisan command to update secrets via CI/CD pipelines or composer `post-install-cmd` scripts.

Instructions
------------

[](#instructions)

### 1. Set up Infisical

[](#1-set-up-infisical)

- Set up an Infisical account if you haven't already. Create a project with secrets.
- Install the Infisical CLI tool on your device by following the instructions at [Infisical CLI Installation](https://docs.infisical.com/cli/installation).

### 2. Authenticate and configure your project

[](#2-authenticate-and-configure-your-project)

You can authenticate and configure your project in one of two ways:

- **Login with identity**:

    Run [`infisical login`](https://infisical.com/docs/cli/commands/login) to authenticate with a user identity or a machine identity.

    Then run [`infisical init`](https://infisical.com/docs/cli/commands/init) to select the project and generate the `.infisical.json` file. We recommend committing this file to your repository.
- **Use a service token**:

    Create a Service Token scoped for your designed environment.

    Copy your specific Project ID from your Infisical settings page.

    Set the following environment variables in your base `.env` file:

    ```
    INFISICAL_PROJECT_ID=your-project-id
    INFISICAL_TOKEN=your-service-token
    ```

### 3. Install this package

[](#3-install-this-package)

You know the drill:

```
composer require stechstudio/laravel-infisical
```

### 4. Specify your environment

[](#4-specify-your-environment)

Infisical needs to know which environment to pull secrets from. You can do this one of three ways:

- **Environment Variable**: Set the `INFISICAL_ENVIRONMENT` environment variable in a base `.env` file to the desired environment slug.

    ```
    INFISICAL_ENVIRONMENT=prod
    ```
- **CLI Argument**: Pass the `--env` option when running the Artisan command.

    ```
    php artisan infisical:merge --env=prod
    ```
- **Custom Resolver**: If you want to dynamically resolve the environment slug, provide a callback in your application service provider.

    ```
    use STS\LaravelInfisical\Facades\Infisical;

    Infisical::resolveEnvironmentUsing(function () {
         return 'prod'; // Replace with your logic to determine the environment slug
    });
    ```

Important

You must provide the *slug* of an existing environment. See your project Settings &gt; Secrets Management page to view all your environments and slugs.

### 5. Run the command (manually or automatically)

[](#5-run-the-command-manually-or-automatically)

You can run the command manually to merge secrets into your `.env` file, or add it to your deployment scripts.

```
php artisan infisical:merge
```

You can also add this to the `scripts` section of your `composer.json` file. This will automatically merge secrets from Infisical into your `.env` file after every composer install or update.

```
"post-install-cmd": [
    "@php artisan infisical:merge"
],
```

### 6. Profit!

[](#6-profit)

You should see "Environment \[prod\] variables merged successfully". If you look at your `.env` file you should see that all the secrets from Infisical have been added to it.

License
-------

[](#license)

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

###  Health Score

31

—

LowBetter than 71% of packages

Maintenance44

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Every ~0 days

Total

2

Last Release

218d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/315be5f111b5501a41b99a0205c9c85915335391168a0ed10316546a1a38bbd8?d=identicon)[jszobody](/maintainers/jszobody)

---

Top Contributors

[![jszobody](https://avatars.githubusercontent.com/u/203749?v=4)](https://github.com/jszobody "jszobody (9 commits)")

---

Tags

laravelenvironmentenvsecretsinfisical

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/stechstudio-laravel-infisical/health.svg)

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

###  Alternatives

[encodia/laravel-health-env-vars

Custom check for Spatie's Laravel Health - Ensure every .env variable you need has been set

20135.6k](/packages/encodia-laravel-health-env-vars)[msztorc/laravel-env

Laravel env helper commands

7854.5k](/packages/msztorc-laravel-env)[tamer-dev/laravel-env-cli

laravel commands to work with .env file in cli

126.1k](/packages/tamer-dev-laravel-env-cli)

PHPackages © 2026

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