PHP code example of kcdev / laravel-setting
1. Go to this page and download the library: Download kcdev/laravel-setting 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/ */
kcdev / laravel-setting example snippets
use Setting;
// Get setting
Setting::get('someKey');
// Get setting, with a default fallback value if the key doesn't exist
Setting::get('yourKey', 'Default value');
// Set setting
Setting::set('yourKey', 'yourValue');
// Remove setting
Setting::remove('yourKey');
// Check the setting exists
Setting::exists('yourKey');
bash
php artisan vendor:publish --provider="Kcdev\Setting\SettingServiceProvider"
php artisan migrate
bash
php artisan option:set {yourKey} {yourValue}