PHP code example of stevenlei / laravel-keyvalue

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

    

stevenlei / laravel-keyvalue example snippets


'providers' => [
    // ...
    StevenLei\LaravelKeyValue\ServiceProvider::class,
],

'aliases' => [
    // ...
    'KeyValue' => StevenLei\LaravelKeyValue\Facade::class,
],

# Get the string value
StevenLei\LaravelKeyValue\Facade::getValue($key, $throwException = true);
# Get the json object
StevenLei\LaravelKeyValue\Facade::getJsonValue($key, $throwException = true);
# Get the array
StevenLei\LaravelKeyValue\Facade::getArrayValue($key, $throwException = true);
# Get the collection
StevenLei\LaravelKeyValue\Facade::getCollectionValue($key, $throwException = true);

kv_get($key, $type = KeyValue::TYPE_STRING, $throwException = true);
shell
php composer.phar 
shell
php artisan vendor:publish --provider="StevenLei\LaravelKeyValue\ServiceProvider"