Installation

Install the SecretStash CLI package and configure environment variables for secure variable management in Laravel applications.

Requirements

  • PHP 8.4+
  • Laravel 11+
  • A SecretStash API token and Application ID

Install the CLI package

Install the Composer package in your Laravel app:

composer require dniccum/secret-stash-cli

Run the installer. It will optionally publish a config file and generate an encryption key stored locally for securing your variables.

php artisan secret-stash:install

Configure environment variables

Add the following to your app's .env:

SECRET_STASH_API_KEY=your_token_here
SECRET_STASH_APPLICATION_ID=your_application_id_here
  • Create an API token in SecretStash (Profile → Tokens).
  • Create or select an Application in SecretStash and copy its ID.

Optional: Publish config

If you want to customize behavior, publish the config file:

php artisan vendor:publish --tag=secret-stash-config

Next steps