PHP code example of laraveleg / options

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

    

laraveleg / options example snippets


$app->register(LaravelEG\LaravelOptions\LumenOptionsServiceProvider::class);

add_option($key, $value, $expiration);

get_option($key, $default)

has_option($key)

remove_option($key)

'eloquent_mode' => true, // Enable Eloquent Mode

use LaravelEG\LaravelOptions\Traits\HasLaravelEGOptions;

class Unit extends Model
{
    use HasLaravelEGOptions;

$unit = Unit::find(1);
$unit->addOption($key, $value, $expiration);

$unit = Unit::find(1);
$unit->getOption($key, $default)

$unit = Unit::find(1);
$unit->hasOption($key)

$unit = Unit::find(1);
$unit->removeOption($key)
bash
php artisan migrate
bash
php artisan vendor:publish --provider="LaravelEG\LaravelOptions\LaravelOptionsServiceProvider"
bash
php artisan migrate