PHP code example of sachingk / laravel-kvpair

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

    

sachingk / laravel-kvpair example snippets


 sachingk\kvpair\KVPairServiceProvider::class,

 "KVPair"=> sachingk\kvpair\Facade\kvpair::class,

 php artisan vendor:publish --tag=migrations

KVPair::addKVPair("key","value","description","group")

KVPair::addKVPairs("key","value","description","group")

 [
   ["key"=>"key1","value"=>"value1","description"=>"","group"=>"group1"],
   ["key"=>"key2","value"=>"value2","description"=>"","group"=>"group1"],
 ];

KVPair::getKVPairByKey($key)

{
  "key": "A1"
  "value": "A1"
  "description": ""
  "group": "A"
}

KVPair::getKVPairByKeys($keys)

array:2 [▼
  0 => array:4 [▼
    "key" => "A1"
    "value" => "A1"
    "description" => ""
    "group" => "A"
  ]
  1 => array:4 [▼
    "key" => "A2"
    "value" => "A2"
    "description" => ""
    "group" => "A"
  ]
]

array:3 [▼
  "" => "Select"
  "A1" => "A1"
  "A2" => "A2"
]

KVPair::getKVPairByGroup($group)

KVPair::getKVPairByGroups($groups)

KVPair::getKVPairByGroups()

KVPair::deleteKVPairByKey($key)

KVPair::deleteKVPairByKeys($keys)

KVPair::deleteKVPairByGroup($group)

KVPair::deleteKVPairByGroups($groups)

KVPair::deleteAllKVPair()

KVPair::countKVPairByGroup($group)

KVPair::countKVPairByGroups($groups)

KVPair::countAllKVPair()

php artisan vendor:publish --tag=config

php artisan vendor:publish --tag=lang