PHP code example of quentingosset / laravel-config-writer

1. Go to this page and download the library: Download quentingosset/laravel-config-writer 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/ */

    

quentingosset / laravel-config-writer example snippets


Kevyworks\Laravel\ConfigWriter\ServiceProvider::class,

$app->register(Kevyworks\Laravel\ConfigWriter\ServiceProvider::class);

Config::write('app.url', 'http://domain.com');

app('config')->write('app.url', 'http://domain.com');

$writeConfig = new Kevyworks\Laravel\ConfigWriter\DataWriter\Rewrite;
$writeConfig->toFile('path/to/config.php', [
    'item' => 'new value',
    'nested.config.item' => 'value',
    'arrayItem' => ['Single', 'Level', 'Array', 'Values'],
    'numberItem' => 3,
    'booleanItem' => true,
    'app.name' => '%{env("APP_NAME", "MyNewApp")}'
]);