Package Configuration - config

The config element is a simple set of key-value pairs that define the configuration variables to create for the package. The keys are an alphanumeric alias with no spaces, and the value is the default value to create the configuration variable with during package installation.

For example:

  purchase_fee: 4.25
  enable_api: 1

For example's sake, let's say the name of the package is "shop". Once the package is installed, the configuration variables will be available at shop.ALIAS, for example:

$fee = $app->config('shop.purchase_fee');
$enable_api = $app->config('shop.enable_api');

You may also update the value of the configuration variables using the App::setConfigVar method, for example:

$new_fee = 3.5;
$app->setConfigVar('shop.purchase_fee', $new_fee);