{"id":30718063,"url":"https://github.com/stechstudio/laravel-infisical","last_synced_at":"2025-09-03T09:08:16.496Z","repository":{"id":309984848,"uuid":"1038243951","full_name":"stechstudio/laravel-infisical","owner":"stechstudio","description":"Import Infisical application secrets as environment variables for your Laravel application","archived":false,"fork":false,"pushed_at":"2025-08-14T23:33:18.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-15T01:15:48.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stechstudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-14T21:23:02.000Z","updated_at":"2025-08-14T23:32:54.000Z","dependencies_parsed_at":"2025-08-15T01:15:50.401Z","dependency_job_id":"d1d15401-ea85-483f-addf-559684c30902","html_url":"https://github.com/stechstudio/laravel-infisical","commit_stats":null,"previous_names":["stechstudio/laravel-infisical"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/stechstudio/laravel-infisical","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Flaravel-infisical","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Flaravel-infisical/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Flaravel-infisical/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Flaravel-infisical/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stechstudio","download_url":"https://codeload.github.com/stechstudio/laravel-infisical/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Flaravel-infisical/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273417896,"owners_count":25101953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-03T09:08:12.431Z","updated_at":"2025-09-03T09:08:16.488Z","avatar_url":"https://github.com/stechstudio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"1492\" height=\"676\" alt=\"infisical-banner\" src=\"https://github.com/user-attachments/assets/90534b28-65ff-4376-87fc-679d04161de3\" /\u003e\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/stechstudio/laravel-infisical.svg?style=flat-square)](https://packagist.org/packages/stechstudio/laravel-infisical)\n\n[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.\n\n- Leverages the [Infisical CLI](https://docs.infisical.com/cli/installation) to fetch and export secrets.\n- Merges secrets onto your base `.env` file (optional).\n- Provides an Artisan command to update secrets via CI/CD pipelines or composer `post-install-cmd` scripts.\n\n## Instructions\n\n### 1. Set up Infisical\n\n- Set up an Infisical account if you haven't already. Create a project with secrets.\n- Install the Infisical CLI tool on your device by following the instructions at [Infisical CLI Installation](https://docs.infisical.com/cli/installation).\n\n### 2. Authenticate and configure your project\n\nYou can authenticate and configure your project in one of two ways:\n\n- **Login with identity**:\n\n  Run [`infisical login`](https://infisical.com/docs/cli/commands/login) to authenticate with a user identity or a machine identity. \n\n  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.\n\n\n- **Use a service token**:\n\n  Create a Service Token scoped for your designed environment.\n\n  Copy your specific Project ID from your Infisical settings page.\n\n    Set the following environment variables in your base `.env` file:\n    \n     ```dotenv\n     INFISICAL_PROJECT_ID=your-project-id\n     INFISICAL_TOKEN=your-service-token\n     ```\n\n### 3. Install this package\n\nYou know the drill:\n\n```bash\ncomposer require stechstudio/laravel-infisical\n```\n\n### 4. Specify your environment\n\nInfisical needs to know which environment to pull secrets from. You can do this one of three ways:\n\n- **Environment Variable**: Set the `INFISICAL_ENVIRONMENT` environment variable in a base `.env` file to the desired environment slug. \n\n   ```dotenv\n   INFISICAL_ENVIRONMENT=prod\n   ```\n- **CLI Argument**: Pass the `--env` option when running the Artisan command.\n\n   ```bash\n   php artisan infisical:merge --env=prod\n   ```\n\n- **Custom Resolver**: If you want to dynamically resolve the environment slug, provide a callback in your application service provider.\n\n    ```php\n    use STS\\LaravelInfisical\\Facades\\Infisical;\n    \n    Infisical::resolveEnvironmentUsing(function () {\n         return 'prod'; // Replace with your logic to determine the environment slug\n    });\n    ```\n\n\u003e [!IMPORTANT]  \n\u003e You must provide the _slug_ of an existing environment. See your project Settings \u003e Secrets Management page to view all your environments and slugs.\n\n### 5. Run the command (manually or automatically)\n\nYou can run the command manually to merge secrets into your `.env` file, or add it to your deployment scripts.\n\n```bash\nphp artisan infisical:merge\n```\n\nYou 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.\n\n```json\n\"post-install-cmd\": [\n    \"@php artisan infisical:merge\"\n],\n```\n\n### 6. Profit!\n\nYou 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.\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstechstudio%2Flaravel-infisical","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstechstudio%2Flaravel-infisical","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstechstudio%2Flaravel-infisical/lists"}