PHP code example of renoki-co / laravel-yaml-config

1. Go to this page and download the library: Download renoki-co/laravel-yaml-config library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

renoki-co / laravel-yaml-config example snippets


AWS_CLUSTERS='[{"region": "us-east-1", "url": "..."}, {"region": "eu-west-1", "url": "..."}]'

// config/clusters.php
return [
    'aws' => env('AWS_CLUSTERS', json_encode([
        // create a default for it
    ])),
];

foreach (config('clusters.aws') as $cluster) {
    // $cluster['region']
}

// 'clusters' => [
//     ['region' => 'ap-south-1'],
//     ['region' => 'eu-west-1'],
// ]

dump(config('clusters'));
bash
php artisan vendor:publish --provider="RenokiCo\LaravelYamlConfig\LaravelYamlConfigServiceProvider" --tag="config"
bash
echo ".laravel.yaml\n.laravel.yml" >> .gitignore