PHP code example of laravel-daddy / swift-settings

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

    

laravel-daddy / swift-settings example snippets


use LaravelDaddy\SwiftSettings\Facade\SwiftSettingsFacade;

// Retrieve a setting by its key, with a default value if the key doesn't exist
SwiftSettingsFacade::getSetting('key', 'default_value');

// Set a new value for a specific key
SwiftSettingsFacade::setSetting('key', 'value');

// Retrieve a setting by its key, with a default value if the key doesn't exist
swift_settings()->getSetting('key', 'default_value');

// Set a new value for a specific key
swift_settings()->setSetting('key', 'value');