PHPackages                             sukohi/quick-dict - 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. [Database &amp; ORM](/categories/database)
4. /
5. sukohi/quick-dict

ActiveLibrary[Database &amp; ORM](/categories/database)

sukohi/quick-dict
=================

A Laravel package for create migration and seeder from key-value data.

1.0.1(8y ago)011MITPHP

Since Apr 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/SUKOHI/QuickDict)[ Packagist](https://packagist.org/packages/sukohi/quick-dict)[ RSS](/packages/sukohi-quick-dict/feed)WikiDiscussions master Synced 1mo ago

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

QuickDict
=========

[](#quickdict)

A Laravel package for create migration and seeder from key-value data. (This is maintained under Laravel 5.6)

Installation
============

[](#installation)

Execute composer command.

```
composer require sukohi/quick-dict:1.*

```

And publish a configuration file.

```
php artisan vendor:publish --provider="Sukohi\QuickDict\QuickDictServiceProvider"

```

Now you should have `quick-dict.php` in `/config`.

Usage
=====

[](#usage)

Please add key-value data in `quick-dict.php` like so.

```
return [
    'months' => [
        1 => 'January',
        2 => 'February',
        3 => 'March',
        4 => 'April',
        5 => 'May',
        6 => 'June',
        7 => 'July',
        8 => 'August',
        9 => 'September',
        10 => 'October',
        11 => 'November',
        12 => 'December'
    ]
]

```

Then run the next command to add the data into DB.

```
php artisan dict

```

This means that QuickDict creates migration and seeder then run them.

Add new key-value data
======================

[](#add-new-key-value-data)

When you'd like to add new key-value data like so, also run `php artisan dict`. Existing table will be ignored.

```
return [
    'months' => [
        1 => 'January',
        2 => 'February',
        3 => 'March',
        4 => 'April',
        5 => 'May',
        6 => 'June',
        7 => 'July',
        8 => 'August',
        9 => 'September',
        10 => 'October',
        11 => 'November',
        12 => 'December'
    ],
    'weekday_names' => [    // New
        0 => 'Sunday',
        1 => 'Monday',
        2 => 'Tuesday',
        3 => 'Wednesday',
        4 => 'Thursday',
        5 => 'Friday',
        6 => 'Saturday',
    ]
]

```

Update key-value data
=====================

[](#update-key-value-data)

When you change key-value data of existing table, use `php artisan dict:refresh` command. The command has two ways.

First one is with table name.

```
php artisan dict:refresh months

```

And another one is width `--all` option.

```
php artisan dict:refresh --all

```

Of cause this means all of your key-value data will be replaced with new ones.

Recommendation
==============

[](#recommendation)

After running `php artisan dict` command, I recommend you to add new Seeder(s) into `database/seeds/DatabaseSeeder` so that you can manage your key-value data also through seeder commnd like `php artisan migrate:fresh --seed`.

Retrieve key-value data
=======================

[](#retrieve-key-value-data)

You can use `dict()` helper function for retrieving the key-value data like so.

```
$collection = dict('months');

// or

echo dict('months.1');  // January

// or

$collection = dict(['months', 'weekday_names']);
echo $collection->toJson();

```

License
=======

[](#license)

This package is licensed under the MIT License.

Copyright 2018 Sukohi Kuhoh

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~0 days

Total

3

Last Release

2947d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2980d59b309d45df3f2e6e51b1d336614da063240b8f76f873f287cd745ec5db?d=identicon)[Sukohi](/maintainers/Sukohi)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/sukohi-quick-dict/health.svg)

```
[![Health](https://phpackages.com/badges/sukohi-quick-dict/health.svg)](https://phpackages.com/packages/sukohi-quick-dict)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[matanyadaev/laravel-eloquent-spatial

Spatial library for Laravel

3982.9M15](/packages/matanyadaev-laravel-eloquent-spatial)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[dragon-code/laravel-deploy-operations

Performing any actions during the deployment process

240173.5k2](/packages/dragon-code-laravel-deploy-operations)[stayallive/laravel-eloquent-observable

Register Eloquent model event listeners just-in-time directly from the model.

2928.9k7](/packages/stayallive-laravel-eloquent-observable)

PHPackages © 2026

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