1. Go to this page and download the library: Download zahidhassanshaikot/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/ */
zahidhassanshaikot / settings example snippets
return [
'cache' => [
'enabled' => true,
],
];
use zahidhassanshaikot\Settings\Facades\Settings;
Settings::all();
Settings::updateOrCreate('site_name', 'laravel-settings');
Settings::updateOrCreateMultiple(['site_name' => 'laravel-settings', 'timezone' => 'UTC']);
Settings::get('site_name');
Settings::get('missing_key', 'a default value');
Settings::delete('site_name');
settings('site_name');
settings('missing_key', 'a default value');
settings(); // same as Settings::all()