PHP code example of shipu / settings

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

    

shipu / settings example snippets


protected $table = 'site_settings'; // you can change your database table name.
public $timestamps = false;

YourSettingModel::getAll(); // return collection

YourSettingModel::set('key', 'value'); // return null

YourSettingModel::set(['key1' => 'value', 'key2' => ['subkey2' => 'value-of-subkey2'] ]); // return null

YourSettingModel::get('key'); // return collection or string or null

YourSettingModel::get('key2.subkey2'); // return collection or string or null

YourSettingModel::get(); // return collection

YourSettingModel::has('key'); // return bool

YourSettingModel::has(['key1', 'key2']); // return collection

YourSettingModel::forget('key'); // return integer 0 or 1

YourSettingModel::forget(['key1', 'key2']); // return interger - how many key successfully delete.

php artisan vendor:publish --provider="Shipu\Settings\Providers\SettingsServiceProvider"