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

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

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

Import your Infisical applications secrets as Laravel environment variables.

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

Since Aug 15Pushed 9mo 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 1mo ago

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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUwNDUxOTMsIm5iZiI6MTc3NTA0NDg5MywicGF0aCI6Ii8yMDM3NDkvNDc4Mjg2MzkwLTkwNTM0YjI4LTY1ZmYtNDM3Ni04N2ZjLTY3OWQwNDE2MWRlMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwMVQxMjAxMzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mOGY5OGYwZTc4Zjk3MzlkOGY1OGEzOTg4NDE0Zjg4NDdiZWVkZDMwMTNkNTcxMjBjZDY0OWM4ZGU3YjhhOGFlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.afgoSfC2aR5_6y7auOlWQdyzbMyLPWzNWB-lhWHXpjg)](https://private-user-images.githubusercontent.com/203749/478286390-90534b28-65ff-4376-87fc-679d04161de3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUwNDUxOTMsIm5iZiI6MTc3NTA0NDg5MywicGF0aCI6Ii8yMDM3NDkvNDc4Mjg2MzkwLTkwNTM0YjI4LTY1ZmYtNDM3Ni04N2ZjLTY3OWQwNDE2MWRlMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwMVQxMjAxMzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mOGY5OGYwZTc4Zjk3MzlkOGY1OGEzOTg4NDE0Zjg4NDdiZWVkZDMwMTNkNTcxMjBjZDY0OWM4ZGU3YjhhOGFlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.afgoSfC2aR5_6y7auOlWQdyzbMyLPWzNWB-lhWHXpjg)[![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

30

—

LowBetter than 64% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

270d 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

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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