1. Go to this page and download the library: Download stillat/proteus 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/ */
stillat / proteus example snippets
Stillat\Proteus\Support\Facades\ConfigWriter;
// Change the default locale to 'fr' and save to disk:
ConfigWriter::write('app.locale', 'fr');
// Add a new nested entry:
ConfigWriter::write('app.new.entry', 'new-value');
// And then update that new entry:
ConfigWriter::write('app.new.entry', 'updated-value');
Stillat\Proteus\Support\Facades\ConfigWriter;
// Calls to env, and other functions, will be updated.
ConfigWriter::ignoreFunctionCalls(false)->writeMany('app', [
'key' => 'new-value',
'locale' => 'fr',
'timezone' => 'Europe/Paris'
]);
Stillat\Proteus\Support\Facades\ConfigWriter;
// Changes to locale and timezone will be ignored, since they will be preserved.
ConfigWriter::preserve([
'locale', 'timezone'
])->writeMany('app', [
'locale' => 'fr',
'timezone' => 'Europe/Paris'
]);
use Stillat\Proteus\Support\Facades\ConfigWriter;
$document = ConfigWriter::edit('app')
->set('locale', 'fr')
->set('timezone', 'Europe/Paris')
->preview();