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

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

skotner/laravel-meta
====================

Metatags for all Laravel models.

1.0.1(5y ago)053MITPHPCI failing

Since Nov 20Pushed 3w ago1 watchersCompare

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

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Create meta tags on all Laravel models
======================================

[](#create-meta-tags-on-all-laravel-models)

The `skoTner/laravel-meta` package provides easy to use functions for setting, getting and deleting meta tags on all your Eloquent models. The Package stores all meta tags in the `meta` table, or you can choose custom table if needed.

Here's a demo of how you can use it:

```
$model->setMeta('foo', 'bar');
$model->getMeta('foo'); // Returns 'bar'
```

You can also set multiple tags at once:

```
$model->setMeta([
	'animal' => 'sheep',
	'flower' => 'rose',
	'drink'  => 'milk'
]);
```

Documentation
-------------

[](#documentation)

You'll find the documentation on .

Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving? Feel free to [create an issue on GitHub](https://github.com/skoTner/laravel-meta/issues), I'll try to address it as soon as possible.

If you've found a security issue please mail  instead of using the issue tracker.

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

[](#installation)

You can install the package via composer:

```
composer require skoTner/laravel-meta
```

The package will automatically register itself.

You can publish the migration and config with:

```
php artisan vendor:publish --provider="Skotner\Meta\MetaServiceProvider"
```

*Note*: The default migration assumes you are using integers for your model IDs. If you are using UUIDs, or some other format, adjust the format of the model\_id field in the published migration before continuing.

After publishing the migration you can create the `meta` table by running the migrations:

```
php artisan migrate
```

You can optionally change the table name in the config file:

```
return [

	/*
	* Table name where the meta tags are stored.
	*/
	'table_name' => 'meta',

];
```

Usage
-----

[](#usage)

First, you add the `Skotner\Meta\Meta` trait to your model(s):

```
use Illuminate\Foundation\Auth\User as Authenticatable;
use Skotner\Meta\Meta;

class User extends Authenticatable
{
    use Meta;

    // ...
}
```

This allows you to set, get and delete meta tags on the model. To use these functions, it is as easy as:

### Set a meta tag

[](#set-a-meta-tag)

You can either set a single meta tag to a model, or you can assign multiple meta tags in one go:

```
// Adding a single meta tag
$user->setMeta('foo', 'bar');

// Adding multiple meta tags at once
$user->setMeta([
	'animal' => 'sheep',
	'flower' => 'rose',
	'drink'  => 'milk'
]);
```

### Get a meta tag

[](#get-a-meta-tag)

Getting a meta tag is as easy as it can be:

```
$user->getMeta('foo'); // Will return "bar" if set as above, or will return null if it doesn't exist
```

### Deleting a meta tag

[](#deleting-a-meta-tag)

```
$user->deleteMeta('foo'); // Deletes the meta tag with key "foo" if it exists
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Free to use
-----------

[](#free-to-use)

You're free to use this package, but if it makes it to your production environment we highly appreciate you stating credits to us:

We are: Skotner Gruppen AS - [www.skotner.no](http://www.skotner.no) - Norway

Credits
-------

[](#credits)

- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance62

Regular maintenance activity

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~791 days

Total

2

Last Release

1938d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/82436c86226787f81022cee4fc6c82eaef5618ca7ed25ff7fc41ab52cc1c0cde?d=identicon)[skoTner](/maintainers/skoTner)

---

Top Contributors

[![skoTner](https://avatars.githubusercontent.com/u/2727377?v=4)](https://github.com/skoTner "skoTner (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelmeta

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[zoha/laravel-meta

a package for working with models meta

236121.7k](/packages/zoha-laravel-meta)[torann/laravel-meta-tags

A package to manage Header Meta Tags

65273.3k4](/packages/torann-laravel-meta-tags)[forxer/laravel-gravatar

A library providing easy gravatar integration in a Laravel project.

4235.6k](/packages/forxer-laravel-gravatar)[fomvasss/laravel-meta-tags

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

3028.9k](/packages/fomvasss-laravel-meta-tags)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)

PHPackages © 2026

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