stechstudio/laravel-infisical 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stechstudio/laravel-infisical

Composer 安装命令:

composer require stechstudio/laravel-infisical

包简介

Import your Infisical applications secrets as Laravel environment variables.

README 文档

README

This package has been abandoned. We have moved our secrets management to a new package called Keep.

Infisical 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 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

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.

2. Authenticate and configure your project

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

  • Login with identity:

    Run infisical login to authenticate with a user identity or a machine identity.

    Then run infisical 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

You know the drill:

composer require stechstudio/laravel-infisical

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 > Secrets Management page to view all your environments and slugs.

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!

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

The MIT License (MIT). Please see License File for more information.

stechstudio/laravel-infisical 适用场景与选型建议

stechstudio/laravel-infisical 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 709 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 08 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「environment」 「env」 「secrets」 「infisical」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 stechstudio/laravel-infisical 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 stechstudio/laravel-infisical 我们能提供哪些服务?
定制开发 / 二次开发

基于 stechstudio/laravel-infisical 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 709
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 20
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-14