Download the PHP package sachingk/laravel-kvpair without Composer

On this page you can find all versions of the php package sachingk/laravel-kvpair. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-kvpair

Laravel KVPair

KV Pair System For Laravel 5.4

Introduction

Key-Value pair is being used in most of the cases where only developer will maintain and change the list. Developer usually tends to keep these key-value pair in config file.

While this works just fine in small applications, it becomes very difficult to manage and maintain when the list grows.Unfortunately all application starts small, but grows big very quickly.

To address this problem, I have developed a KV Pair system for laravel framework which stores the KV Pair in the database.

Benefits, Benefits and Benefits

Installation

Require this package with composer:

After updating composer, add the ServiceProvider to the providers array in config/app.php

Laravel 5.x:

Add Service Provider

Add Facade

If you want to use the facade , add this to your facades in app.php:

Make Migration

Now you need to run artisan migrate command via command line. If you wish to add more columns to the table before migration then run the following command in command line.

Now the migration file get copied to /database/migrations folder. Add any extra columns you need and then run the migrate artisan command.

Usage

This KV pair system provides 4 set of functions to work with KV store.

Adding KV Pair to store

You can add KV Pair to the store in 2 ways

One at a time

This take 4 parameters

This function will return true or false. While True stands for successful addition, False stands for failure. False will be returned if

Bulk Addition

This take 1 parameter which is an array.

This function will return true or false. While True stands for successful addition, False stands for failure. False will be returned if

Retrieving KV Pair from store

You can add KV Pair to the store in 5 ways

Get By Single Key

This take 1 parameter i.e key

This function will return object of KV Pair that matches the given key or return false if no KV pair found. The object returned will follow below pattern.

Get By Multiple Keys

This take 2 parameter

This function will return array of KV Pairs that matches the given keys or return false if no KV pairs found. The output returned will follow below pattern.

However, if the forDropDown is set to true then output returned will follow below pattern.

The string "select" can support multiple languages.See the Multilingual Section for more details.

The associated value of "select" can be configurable. See Configuration Section for more details.

Get By Single Group

This take 2 parameter

The output follows the same pattern as defined in Get By Multiple Keys (above)

Get By Multiple Groups

This take 2 parameter

The output follows the same pattern as defined in Get By Multiple Keys (above)

Get All KV Pairs for KV Store

This take 1 parameter

The output follows the same pattern as defined in Get By Multiple Keys (above)

Deleting KV Pair from store

You can delete KV Pair from store in 5 ways

Delete By Single Key

This take 1 parameter i.e key

This function will return true or false. While True stands for successful addition, False stands for failure. False will be returned if

Delete By Multiple Key

This take 1 parameter

This function will return true or false.While True stands for successful addition, False stands for failure. False will be returned if

Delete By Single Group

This take 1 parameter

This function will return true or false.While True stands for successful addition, False stands for failure. False will be returned if

Delete By Single Group

This take 1 parameter

This function will return true or false.While True stands for successful addition, False stands for failure. False will be returned if

Delete All KV pair from store

This take no parameter

This function will return true or false.While True stands for successful addition, False stands for failure. False will be returned if

Counting KV Pair in the store

You can delete KV Pair from store in 3 ways

Count By Single Group

This take 1 parameter

This function will return the integer value.

Count By Multiple Groups

This take 1 parameter

This function will return the integer value.

Count All KV pair in the store

This take no parameter

This function will return the integer value.

Configuration

This package has 2 configurations which developer can set based on their choice.

alwaysGetForDropdown

If this is set to TRUE all the get functions (except getKVPairByKey) will give the output ready to bind with select html control by default. The $forDropDown parameter passed will be ignored

selectKey

Value assigned to this will used as a key for select when rendering the get function for dropdown.

How to configure

To set your configurations , you have to publish the config file using artisan command.

Now the configuration file get copied to /config folder.You can set your preference here.

Multilingual

This package support multiple language for "select" during the output for dropdown.The translations are take from the language files based on the setting of locale in /Config/app.php.

To start with you can run following publish command to get the default language files of this package.

Now the language files get copied to /resources/lang folder. You can add more languages from here by creating individual folder for each language and adding kvpair_lang.php under them.

For now this package creates language file for english and kannada (indian language)


All versions of laravel-kvpair with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sachingk/laravel-kvpair contains the following files

Loading the files please wait ....