GitHub Repository

apiato

Definition

Configs are files that container configurations. For more details about them check this doc.

In each Apiato container, there are two types of config files:

Principles

Rules

Folder Structure

 - App
    - Containers
        - {container-name}
            - Configs
                - config1-container.php
                - package-config-file1.php
                - ...
    - Ship
        - Features
            - Configs
                - apiato.php
                - ...
- config
    - app.php
    - ...

Code Samples

Example simple Config file

<?php

return [

    'containers' => [
        /*
        |--------------------------------------------------------------------------
        | Default Namespace
        |--------------------------------------------------------------------------
        */
        'namespace'       => 'App',

        // some other config params here...
    ],

You can access the respective configuration key like this:

$value = Config::get('config1-container.containers.namespace');     // returns 'App'
$value = config('config1-container.containers.namespace');          // same, but using a function

$defaultValue = Config::get('config1-container.unknown.key', 'defaultvalue');   // returns 'defaultvalue' as this key is not set!