PHPackages                             stevenlei/laravel-keyvalue - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. stevenlei/laravel-keyvalue

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

stevenlei/laravel-keyvalue
==========================

Laravel KeyValue

v1.0.2(7y ago)177MITJavaScriptPHP ^7.1.3

Since Jan 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ShaneStevenLei/laravel-keyvalue)[ Packagist](https://packagist.org/packages/stevenlei/laravel-keyvalue)[ Docs](https://github.com/ShaneStevenLei/laravel-keyvalue)[ RSS](/packages/stevenlei-laravel-keyvalue/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

laravel-keyvalue
================

[](#laravel-keyvalue)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist stevenlei/laravel-keyvalue "^1.0"
```

or add

```
"stevenlei/laravel-keyvalue": "^1.0"
```

to the require section of your `composer.json` file.

Environment Requirements
------------------------

[](#environment-requirements)

- PHP &gt;= 7.1.3
- Laravel &gt;= 5.6
- Bootstrap &gt;= 4.0

Usage
-----

[](#usage)

- 1. Registering Provider in the `config/app.php` configuration file:

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

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

- 2. Create configuration files:

```
php artisan vendor:publish --provider="StevenLei\LaravelKeyValue\ServiceProvider"
```

- 3. The configuration file: `config/keyvalue.php`, modify the configuration items in the `.env` file, for example:

```
KEY_VALUE_PREFIX=KV_
KEY_VALUE_TTL=7200
KEY_VALUE_USERNAME=username
KEY_VALUE_MIDDLEWARE=web,auth

```

- 4. How to get the key's value in the program?

```
# 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);
```

or use the helper function

```
kv_get($key, $type = KeyValue::TYPE_STRING, $throwException = true);
```

Routes
------

[](#routes)

- Index page
    - `/key-value/index`
    - alias: `keyvalue.index`
- Create page or store resource
    - `/key-value/create`
    - alias: `keyvalue.create`
- Update page or update resource
    - `/key-value/update`
    - alias: `keyvalue.update`
- Delete resource(only soft delete)
    - `/key-value/delete`
    - alias: `keyvalue.delete`

Middleware
----------

[](#middleware)

Add middleware in the `.env` file, separated by commas, for example:

```
KEY_VALUE_MIDDLEWARE=web,auth

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Total

3

Last Release

2665d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/014076f96f00c27c30fd9283a18f315ae208963c9674606f01d79f87423375ad?d=identicon)[ShaneStevenLei](/maintainers/ShaneStevenLei)

---

Top Contributors

[![shanestevenlei](https://avatars.githubusercontent.com/u/7611417?v=4)](https://github.com/shanestevenlei "shanestevenlei (9 commits)")

---

Tags

keyvaluestorelaravellaravel-keyvaluelaravelkeyvalue

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stevenlei-laravel-keyvalue/health.svg)

```
[![Health](https://phpackages.com/badges/stevenlei-laravel-keyvalue/health.svg)](https://phpackages.com/packages/stevenlei-laravel-keyvalue)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[firefly-iii/data-importer

Firefly III Data Import Tool.

8005.8k](/packages/firefly-iii-data-importer)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

98145.2k3](/packages/nickurt-laravel-akismet)[creasi/laravel-nusa

A Laravel package that aim to provide Indonesia' Administrative Data

997.7k2](/packages/creasi-laravel-nusa)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1319.7k3](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
