1. Go to this page and download the library: Download vkovic/laravel-settings 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/ */
vkovic / laravel-settings example snippets
// Set setting value as string
Settings::set('foo', 'bar');
// Get setting value
Settings::get('foo'); // : 'bar'
// In case there is no settings found for given key,
// we can pass default value to return
Settings::get('baz', 'default'); // : 'default'
Settings::set('computer.display.resolution', '1280x1024');
Settings::set('computer.display.brightness', 97);
Settings::set('computer.sound.volume', 54);
Settings::set('computer.mic.volume', 0);
Settings::query('computer.display.*');
// Result:
// [
// 'computer.display.resolution' => '1280x1024',
// 'computer.display.brightness' => 97
// ]
Settings::query('*.sound.*');
// Result:
// [
// 'computer.sound.volume' => 54
// ]
Settings::query('computer.*.volume');
// Result:
// [
// 'computer.sound.volume' => 54,
// 'computer.mic.volume' => 0
// ]
// In case there is no settings found for given query,
// we can pass default value to return
Settings::query('computer.sound.bass', 85); // : 85