PHPackages                             vkovic/laravel-meta - 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. vkovic/laravel-meta

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

vkovic/laravel-meta
===================

Laravel meta storage for different purposes

v0.3.0(6y ago)697122MITPHPPHP ^7.1CI failing

Since Dec 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/vkovic/laravel-meta)[ Packagist](https://packagist.org/packages/vkovic/laravel-meta)[ RSS](/packages/vkovic-laravel-meta/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (10)Used By (2)

Laravel Meta
============

[](#laravel-meta)

[![Build](https://camo.githubusercontent.com/f6fab4df4617b1c200a9c40660d42a35cf35b864846b4edbd924ecf79303d251/68747470733a2f2f6170692e7472617669732d63692e6f72672f766b6f7669632f6c61726176656c2d6d6574612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/vkovic/laravel-meta)[![Downloads](https://camo.githubusercontent.com/d226bb1a7dcfc1464444b6d58f06e45877575aa11fa19cc2ceb2e281323d1c5d/68747470733a2f2f706f7365722e707567782e6f72672f766b6f7669632f6c61726176656c2d6d6574612f646f776e6c6f616473)](https://packagist.org/packages/vkovic/laravel-meta)[![Stable](https://camo.githubusercontent.com/8eb9031621c100ae100cabe9f307dafc4ec7d4b142260094217b067efe142df2/68747470733a2f2f706f7365722e707567782e6f72672f766b6f7669632f6c61726176656c2d6d6574612f762f737461626c65)](https://packagist.org/packages/vkovic/laravel-meta)[![License](https://camo.githubusercontent.com/edfaee79fa84b67f4030e89c4ad6ed48c83ba90bc7f3d611a585b17cb71b5ac9/68747470733a2f2f706f7365722e707567782e6f72672f766b6f7669632f6c61726176656c2d6d6574612f6c6963656e7365)](https://packagist.org/packages/vkovic/laravel-meta)

### Laravel database meta storage for different purposes

[](#laravel-database-meta-storage-for-different-purposes)

This is simple package for easy storage and retrieval of all kind (different data types) of metadata for your application in dedicated table.

---

Compatibility
-------------

[](#compatibility)

The package is compatible with **Laravel** versions `5.5`, `5.6`, `5.7`, `5.8` and `6`

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

[](#installation)

Install the package via composer:

```
composer require vkovic/laravel-meta
```

Run migrations to create table which will be used to store our metadata:

```
php artisan migrate
```

Usage
-----

[](#usage)

Let's create and retrieve some metadata:

```
// Set meta value as string
Meta::set('foo', 'bar');

// Get meta value
Meta::get('foo')) // : 'bar'

// In case there is no metadata found for given key,
// we can pass default value to return
Meta::get('baz', 'default'); // : 'default'
```

Multiple records could be retrieved using `query` method and wildcard `*`:

```
Meta::set('settings.display.resolution', '1280x1024');
Meta::set('settings.display.brightness', 97);
Meta::set('settings.sound.volume', 54);
Meta::set('settings.mic.volume', 0);

Meta::query('settings.display.*');
// Result:
// [
//     'settings.display.resolution' => '1280x1024',
//     'settings.display.brightness' => 97
// ]

Meta::query('*.sound.*');
// Result:
// [
//     'settings.sound.volume' => 54
// ]

Meta::query('settings.*.volume');
// Result:
// [
//     'settings.sound.volume' => 54,
//     'settings.mic.volume' => 0
// ]

// In case there is no metadata found for given query,
// we can pass default value to return
Meta::query('settings.sound.bass', 85); // : 85
```

Beside string, metadata can also be stored as integer, float, null, boolean or array:

```
Meta::set('age', 35);
Meta::set('temperature', 24.7);
Meta::set('value', null);
Meta::set('employed', true);
Meta::set('fruits', ['orange', 'apple']);

Meta::get('age'); // : 35
Meta::get('temperature'); // : 24.7
Meta::get('value'); // : null
Meta::get('employed'); // : true
Meta::get('fruits'); // : ['orange', 'apple']
```

We can easily check if meta exists without actually retrieving it from meta table:

```
Meta::set('foo', 'bar');

Meta::exists('foo'); // : true
```

Counting all meta records is also a breeze:

```
Meta::set('a', 'one');
Meta::set('b', 'two');

Meta::count(); // : 2
```

If we need all metadata, or just keys, no problem:

```
Meta::set('a', 'one');
Meta::set('b', 'two');
Meta::set('c', 'three');

// Get all metadata
Meta::all(); // : ['a' => 'one', 'b' => 'two', 'c' => 'three']

// Get only keys
Meta::keys(); // : [0 => 'a', 1 => 'b', 2 => 'c']
```

Also, we can remove meta easily:

```
Meta::set('a', 'one');
Meta::set('b', 'two');
Meta::set('c', 'three');

// Remove meta by key
Meta::remove('a');

// Or array of keys
Meta::remove(['b', 'c']);
```

If, for some reason, we want to delete all meta at once, no problem:

```
// This will delete all metadata from our meta table!
Meta::purge();
```

If we need to access underlying meta model (Laravel Eloquent Model) to manipulate or retrieve data with unlimited control we can get it like this:

```
Meta::getModel();
```

---

Contributing
------------

[](#contributing)

If you plan to modify this Laravel package you should run tests that comes with it. Easiest way to accomplish this would be with `Docker`, `docker-compose` and `phpunit`.

First, we need to initialize Docker containers:

```
docker-compose up -d
```

After that, we can run tests and watch the output:

```
docker-compose exec app vendor/bin/phpunit
```

---

Similar packages
----------------

[](#similar-packages)

The package is one of three metadata packages based on the same approach:

- vkovic/laravel-meta (this package - general purpose meta storage)
- [vkovic/laravel-model-meta](https://github.com/vkovic/laravel-model-meta) (Laravel model related meta storage)
- [vkovic/laravel-settings](https://github.com/vkovic/laravel-settings) (app specific settings meta storage)

Packages can be used separately or together. Internally they are using same table and share common logic.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

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

Recently: every ~75 days

Total

9

Last Release

2453d ago

PHP version history (2 changes)v0.1.0PHP ^7.0

v0.3.0PHP ^7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4613605?v=4)[Vladimir Ković](/maintainers/vkovic)[@vkovic](https://github.com/vkovic)

---

Top Contributors

[![vkovic](https://avatars.githubusercontent.com/u/4613605?v=4)](https://github.com/vkovic "vkovic (27 commits)")

---

Tags

laraveldatameta

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vkovic-laravel-meta/health.svg)

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

###  Alternatives

[zoha/laravel-meta

a package for working with models meta

236133.9k](/packages/zoha-laravel-meta)[eusonlito/laravel-meta

A package to manage Header Meta Tags

193545.3k2](/packages/eusonlito-laravel-meta)[torann/laravel-meta-tags

A package to manage Header Meta Tags

69279.6k3](/packages/torann-laravel-meta-tags)[jaybizzle/hasmeta

Access model meta data as if it was a property on your model

291.9k](/packages/jaybizzle-hasmeta)[fomvasss/laravel-meta-tags

A package to manage SEO (meta-tags, xml-fields, etc.)

3129.8k](/packages/fomvasss-laravel-meta-tags)[xefi/faker-php-laravel

Faker php integration with laravel

2619.7k](/packages/xefi-faker-php-laravel)

PHPackages © 2026

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