PHPackages                             priblo/laravel-has-attributes - 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. priblo/laravel-has-attributes

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

priblo/laravel-has-attributes
=============================

EAV based attributes as a Trait

v1.3.0(7y ago)2484MITPHPPHP &gt;=5.6.4

Since Oct 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Priblo/Laravel-Has-Attributes)[ Packagist](https://packagist.org/packages/priblo/laravel-has-attributes)[ RSS](/packages/priblo-laravel-has-attributes/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (6)Versions (8)Used By (0)

Laravel Has Attributes
======================

[](#laravel-has-attributes)

###### EAV Attributes in an handy Trait

[](#eav-attributes-in-an-handy-trait)

[![Build Status](https://camo.githubusercontent.com/b105e0b9c0f92ea78522dfc4c95d0bbc63a001b116d90d2f786e2037cc734a05/68747470733a2f2f7472617669732d63692e6f72672f507269626c6f2f4c61726176656c2d4861732d417474726962757465732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Priblo/Laravel-Has-Settings)[![Codacy Badge](https://camo.githubusercontent.com/31775b71419503be474bb5edaaa944710f5d0146e26e31e8004a508d2bb67755/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6661376634353934356635333435316561373638643335373261343231333833)](https://www.codacy.com/app/0plus1/Laravel-Has-Attributes?utm_source=github.com&utm_medium=referral&utm_content=Priblo/Laravel-Has-Attributes&utm_campaign=Badge_Grade)

This package provides a trait to attach attributes to any Eloquent model. The common use case is to add Settings to a model.

Attributes are stored following the [Entity-Attribute-Value model](https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model). Data is abstracted using the [Decorator pattern](https://en.wikipedia.org/wiki/Decorator_pattern).

Install
-------

[](#install)

*Requires: Laravel &gt;=5.4*

**Composer**

```
    composer require priblo/laravel-has-attributes

```

**Laravel**

This package supports Auto Discovery. If your Laravel version doesn't support it or you have disabled it, you can install this package by adding to the 'providers' array in *./config/app.php*

```
Priblo\LaravelHasAttributes\LaravelServiceProvider::class,
```

Then run:

```
php artisan vendor:publish --provider="Priblo\LaravelHasAttributes\LaravelServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="Priblo\LaravelHasAttributes\LaravelServiceProvider" --tag="config"

```

Then migrate:

```
php artisan migrate

```

Cache
-----

[](#cache)

**Caching requires a driver which supports tags**. File and Database won't work, redis is suggested. Please make sure to either disable caching in the config or use the array driver for local development.

In the *has-settings.php* config file you can enable/disable caching and set the cache expiration time.

**Caching is enabled by default**

Notes
-----

[](#notes)

Please do remember that each of the settings in a EAV model are set in a TEXT field, thus a value of *true* will be stored as *"1"*

Roadmap
-------

[](#roadmap)

- More tests
- Expand README.MD

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Recently: every ~107 days

Total

7

Last Release

2655d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9cea619fe9ba025fd94836d48a3edcbbef60baa38a810048f39f8ef382c780c5?d=identicon)[0plus1](/maintainers/0plus1)

---

Top Contributors

[![0plus1](https://avatars.githubusercontent.com/u/420815?v=4)](https://github.com/0plus1 "0plus1 (37 commits)")

---

Tags

eaveloquentlaraveltrait

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/priblo-laravel-has-attributes/health.svg)

```
[![Health](https://phpackages.com/badges/priblo-laravel-has-attributes/health.svg)](https://phpackages.com/packages/priblo-laravel-has-attributes)
```

###  Alternatives

[cviebrock/eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel

4.0k13.6M253](/packages/cviebrock-eloquent-sluggable)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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