PHP code example of dominservice / laravel-config

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

    

dominservice / laravel-config example snippets


'providers' => [
    // ...
    Dominservice\LaravelConfig\ServiceProvider::class,
],

use Dominservice\LaravelConfig\Config;

(new Config())->buildCache();

use Dominservice\LaravelConfig\Config;

(new Config())->set('app.name', 'My App', true);

(new Config())->set([
    'app.debug' => false,
    'app.timezone' => 'UTC',
], true);

(new Config())->set([
    ['app.locale', 'en'],
    ['app.faker_locale', 'en_US'],
], true);

// app/Http/Kernel.php
protected $middlewareGroups = [
    'web' => [
        // ...
        Dominservice\LaravelConfig\Http\Middleware\Optimize::class,
    ],
];

// config/optimize.php
return [
    'custom_files_config' => [
        'module' => 'modules/module/config/module.php',
        'payments' => [
            'modules/payments/config/gateways.php',
            'modules/payments/config/rules.php',
        ],
    ],
];

'env' => optimize_config('APP_ENV', 'production'),
shell
php artisan vendor:publish --provider="Dominservice\\LaravelConfig\\ServiceProvider" --tag=optimize-config
php artisan vendor:publish --provider="Dominservice\\LaravelConfig\\ServiceProvider" --tag=optimize-migrations
shell
php artisan migrate
shell
php artisan dso:optimize-config