PHP code example of hankz / laravel-system-settings

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

    

hankz / laravel-system-settings example snippets




return [
    /**
     * use table name.
     */
    'table_name' => 'system_settings',

    /**
     * default value.
     */
    'default' => [
        'group' => 'default',
    ],
];


SystemSettingManager::new('keyName', 'value', 'groupName', 'description');

SystemSettingManager::has('keyName', 'groupName');

SystemSettingManager::all();

SystemSettingManager::get('keyName', 'groupName', 'defaultValue');

SystemSettingManager::set('keyName', 'newValue', 'groupName', 'newDescription', true);

SystemSettingManager::getByGroup('groupName');

SystemSettingManager::setByGroup(['key1' => ['value' => 'value1', 'description' => 'desc1']], 'groupName', true);

SystemSettingManager::delete('keyName', 'groupName');
bash
php artisan vendor:publish --provider="Hankz\LaravelSystemSettings\SystemSettingProvider"
bash
php artisan migrate