PHP code example of utyemma / larasetting

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

    

utyemma / larasetting example snippets


$exampleSettings = app(\App\Settings\ExampleSettings::class);
$value = $exampleSettings->some_key; // Retrieve the value of a setting

$exampleSettings->some_key = 'New Value'; // Update the value of a setting

$exampleSettings->update([
    'key1' => 'Value1',
    'key2' => 'Value2',
]);

$settingsArray = $exampleSettings->toArray();

protected $strict = false;
bash
   php artisan vendor:publish --tag=larasettings-migrations
   
bash
   php artisan migrate
   
bash
php artisan make:setting ExampleSettings
bash
php artisan settings:seed --class=ExampleSettings