PHP code example of gigabait93 / laravel-settings

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

    

gigabait93 / laravel-settings example snippets


use Gigabait93\LaravelSettings\Facades\Settings;

Settings::set('site.name', 'My Site');
$name = Settings::get('site.name');

// or helper
sset('items_per_page', 20);
$value = sget('items_per_page');

settings()->setMany([
    'a' => 1,
    'b' => true,
]);

$values = settings()->many(['a', 'b']); // ['a' => 1, 'b' => true]
bash
   php artisan vendor:publish --provider="Gigabait93\LaravelSettings\Providers\LaravelSettingsServiceProvider" --tag=config
   php artisan vendor:publish --provider="Gigabait93\LaravelSettings\Providers\LaravelSettingsServiceProvider" --tag=migrations
   
bash
   php artisan migrate