Download the PHP package audunru/config-secrets without Composer

On this page you can find all versions of the php package audunru/config-secrets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package config-secrets

Configuration secrets for Laravel

Build Status Coverage Status StyleCI

Retrieve secrets from AWS Secrets Manager and override config variables in Laravel.

As an example, you could store your database password in AWS Secrets Manager instead of your .env file. This package does not modify your .env file or config files. Instead, the configuration values are set using Laravel's config() helper right after your application has started.

Migration guides

Installation

Step 1: Install with Composer

Step 2: Publish configuration

Publish the configuration file by running:

Step 3: Edit configuration

This package supports two config providers: aws retrieves secrets from AWS Secrets Manager, and the array provider simply retrieves them from config-secrets.php.

Aws

In AWS Secrets Manager:

  1. Create a new secret.
  2. Set the secret value to any number of key/value pairs. You can prefix the secret value with base64: followed by a base64 encoded string. This is useful for private and public keys, for instance.

In your Laravel application:

  1. Set AWS_DEFAULT_REGION in .env or set the region directly in config-secrets.php
  2. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in .env or use any of the other options that AWS SDK offers
  3. Map Laravel configuration keys to secret keys under the aws provider's configuration section in config-secrets.php

Array

The array provider replaces configuration values with values from config-secrets.php for an example. This allows you to keep environment specific configuration values in source control. For obvious reasons, do not use the array provider for values that should be kept secret.

Step 4: Update bootstrap/app.php

Add the following lines to bootstrap/app.php (recommended but not required):

Loading the secrets in bootstrap/app.php instead of in a service provider ensures that you can override (probably) any configuration value. For instance, Laravel's RedisServiceProvider uses the available configuration values when it is registered. Without the code above, you won't be able to override the Redis password.

Step 5: Enable configuration cache

It is very important that you cache your Laravel configuration with php artisan config:cache or php artisan optimize when you use this package. If not, secrets will be retrieved for every request. This process is slow and costly!

Alternatives

AWS Secrets Manager

Development

Testing

Run tests:


All versions of config-secrets with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
aws/aws-sdk-php Version ^3.0
laravel/framework Version ^11.0
spatie/laravel-package-tools Version ^1.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package audunru/config-secrets contains the following files

Loading the files please wait ....