PHP code example of mradang / laravel-options

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

    

mradang / laravel-options example snippets


// set
\Option::set('foo', 'bar');
\Option::set(['foo' => 'bar', 'bar' => 'baz']);

// get
\Option::get('foo'); // bar
\Option::get(['foo', 'bar']); // ['foo' => 'bar', 'bar' => 'baz']
\Option::get('baz', 'abc'); // abc

// has
\Option::has('baz'); // false

// remove
\Option::remove('foo');
\Option::remove(['foo', 'bar']);
shell
php artisan vendor:publish --provider="mradang\\LaravelOptions\\LaravelOptionsServiceProvider"
bash
php artisan migrate:refresh