PHP code example of byancode / remote-config

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

    

byancode / remote-config example snippets


Byancode\RemoteConfig\ServiceProvider::class,

'RemoteConfig' => Byancode\RemoteConfig\Facades\RemoteConfig::class,

return [
    // Application service providers...
    Byancode\RemoteConfig\ServiceProvider::class,

    // Deferred service providers...
];

# GETTER
RemoteConfig::get('foo');
RemoteConfig::get('foo.bar');
RemoteConfig::get('foo__bar');

# SETTER
RemoteConfig::set('foo', ['bar' => 'test']);
RemoteConfig::set('foo.bar', 'test');

$remoteConfig = remote_config();

# GETTER
remote_config('foo');
$remoteConfig->foo;
remote_config('foo.bar');
$remoteConfig->foo__bar;
$remoteConfig->get('foo.bar');

# SETTER
remote_config('foo', ['bar' => 'test']);
$remoteConfig->foo = ['bar' => 'test'];
$remoteConfig->foo__bar = 'test';
$remoteConfig->set('foo.bar', 'test');
bash
php artisan vendor:publish --provider="Byancode\RemoteConfig\ServiceProvider"
bash
php artisan migrate
bash
php artisan config:clear