PHP code example of finagin / laravel-settings

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

    

finagin / laravel-settings example snippets


'providers' => [
    /*
     * Package Service Providers...
     */
    // ...
    Finagin\Settings\SettingsServiceProvider::class,
    // ...
];

$key = 'some_key';
$value = 'some value';
$default = 'default value';

echo Settings::get($key, $default));
// output: default value

Settings::set($key, $value));
echo Settings::get($key, $default));
// output: some value

echo Settings::unset($key));
// output: true
echo Settings::unset($key));
// output: false

echo Settings::get($key, $default));
// output: default value
bash
php artisan vendor:publish --provider="Finagin\Settings\SettingsServiceProvider" --tag="migrations"
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Finagin\Settings\SettingsServiceProvider" --tag="config"