PHP code example of venom / system-settings

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

    

venom / system-settings example snippets


use Venom\SystemSettings\Facades\SystemSettings;

$value = SystemSettings::get('your_key', 'default_value');

SystemSettings::set('your_key', 'your_value', 'string');

SystemSettings::delete('your_key');

$settings = SystemSettings::all(); // Get all settings
$jsonSettings = SystemSettings::all('json'); // Get settings of type 'json'


namespace App\Models;

use Venom\SystemSettings\Models\SystemSettings as BaseSystemSettings;

class CustomSystemSettings extends BaseSystemSettings
{
// Custom logic here
}

// config/system_settings.php
'model' => \App\Models\CustomSystemSettings::class,
bash
php artisan vendor:publish --provider="Venom\SystemSettings\Providers\SystemSettingsServiceProvider" --tag="config"
php artisan vendor:publish --provider="Venom\SystemSettings\Providers\SystemSettingsServiceProvider" --tag="migrations"
bash
php artisan migrate
bash
php artisan settings:get key
bash
php artisan settings:has key
bash
php artisan settings:clear