PHP code example of summergeorge / laravel-options

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

    

summergeorge / laravel-options example snippets


// Get option
option('someKey');

// Get option, with a default fallback value if the key doesn't exist
option('someKey', 'Some default value if the key is not found');

// Set option
option(['someKey' => 'someValue']);

// Remove option
option()->remove('someKey');

// Check the option exists
option_exists('someKey');

use Option;

$check = Option::exists('someKey');
bash
php artisan option:set {someKey} {someValue}