PHP code example of delatbabel / site-config

1. Go to this page and download the library: Download delatbabel/site-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/ */

    

delatbabel / site-config example snippets


    // Access all configuration variables including Laravel + database stored configuration
    $config = config()->all();

    // Fetch a config variable by path
    $my_fruit = config('config.fruit');

protected function bootstrappers()
{
    $bootstrappers = parent::bootstrappers();

    // Add the SiteConfig bootstrapper to the end.
    $bootstrappers[] = 'Delatbabel\SiteConfig\Bootstrap\LoadConfiguration';

    return $bootstrappers;
}

php artisan vendor:publish --tag=migrations --force
php artisan migrate

    $var1 = config('mycode.mykey');  // Or use the facade Config::get('mycode.mykey');
    $var2 = DbConfig::get('mycode.mykey');