PHP code example of yazan / laravel-settings

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

    

yazan / laravel-settings example snippets



$setting =  \Setting::set('age', 18);



$setting =  \Setting::get('age');
// 18


$user = User::find(1);
$user->setSetting('age', 18);


$user->getSetting('age');
// 18


$user->getSettingGroup('default');
//['age' => 18]