PHPackages                             laraplug/attribute-module - 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. laraplug/attribute-module

ActiveAsgard-module[Utility &amp; Helpers](/categories/utility)

laraplug/attribute-module
=========================

v0.3.1(8y ago)12042MITPHPPHP &gt;=7.0.0

Since Feb 11Pushed 2y ago2 watchersCompare

[ Source](https://github.com/laraplug/attribute-module)[ Packagist](https://packagist.org/packages/laraplug/attribute-module)[ RSS](/packages/laraplug-attribute-module/feed)WikiDiscussions master Synced 4d ago

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

[![Latest Stable Version](https://camo.githubusercontent.com/5ca226ce754228866805bf8bd5d7f7921521b165458ad6f18b995225fe413847/68747470733a2f2f706f7365722e707567782e6f72672f6c617261706c75672f6174747269627574652d6d6f64756c652f762f737461626c652e7376673f666f726d61743d666c61742d737175617265)](https://github.com/laraplug/attribute-module/releases)[![Software License](https://camo.githubusercontent.com/7060a0cf28f9db358a373cf7ec28b86be3fe8a209bfb2592dd093c6b303309f4/68747470733a2f2f706f7365722e707567782e6f72672f6c617261706c75672f6174747269627574652d6d6f64756c652f6c6963656e73652e7376673f666f726d61743d666c61742d737175617265)](LICENSE)[![Daily Downloads](https://camo.githubusercontent.com/abf362db931796c2d3f5a9a539b79ba492f9889c7731504da6d63a10c5d71564/68747470733a2f2f706f7365722e707567782e6f72672f6c617261706c75672f6174747269627574652d6d6f64756c652f642f6461696c792e7376673f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/laraplug/attribute-module)[![Monthly Downloads](https://camo.githubusercontent.com/69d265e46d60bb8120fd3aff51ac74359bbda6e17c397fabe016f4ac78c7f74c/68747470733a2f2f706f7365722e707567782e6f72672f6c617261706c75672f6174747269627574652d6d6f64756c652f642f6d6f6e74686c792e7376673f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/laraplug/attribute-module)[![Total Downloads](https://camo.githubusercontent.com/5eb983565ddc6e7fe7dd796f8f9cb6fc21c4601cbf83d3fa0c01a0d76b532ce1/68747470733a2f2f706f7365722e707567782e6f72672f6c617261706c75672f6174747269627574652d6d6f64756c652f642f746f74616c2e7376673f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/laraplug/attribute-module)[![PHP7 Compatible](https://camo.githubusercontent.com/5ab06e607ddbc11fc8f7d38430b77b0b90e07a7a3acfa1d50e8dbcc6f4fd9e68/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laraplug/attribute-module)

Laraplug Attribute
==================

[](#laraplug-attribute)

**Laraplug Attribute** is a EAV e-commerce module, built on top of [AsgardCMS](https://github.com/AsgardCms/Platform) platform.

Successfully implemented on [laraplug/product-module](https://github.com/laraplug/product-module)

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Add EAV to Eloquent model](#add-eav-to-eloquent-model)
    - [Configure attributes on Eloquent model](#configure-attributes-on-eloquent-model)
- [About Laraplug](#about-laraplug)
- [Contributing](#contributing)

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

[](#installation)

1. Install the package via composer:

    ```
    composer require laraplug/attribute-module
    ```
2. Execute migrations via [AsgardCMS](https://github.com/AsgardCms/Platform)'s module command:

    ```
    php artisan module:migrate Attribute
    ```
3. Execute publish via [AsgardCMS](https://github.com/AsgardCms/Platform)'s module command:

    ```
    php artisan module:publish Attribute
    ```
4. Done!

Usage
-----

[](#usage)

### Add EAV to Eloquent model

[](#add-eav-to-eloquent-model)

To add EAV functionality to your Eloquent model, just use the `\Module\Attribute\Traits\Attributable` trait and implement `\Module\Attribute\Contracts\AttributesInterface`like this:

```
use \Module\Attribute\Contracts\AttributesInterface
use \Module\Attribute\Traits\Attributable

class Book extends Model implements AttributesInterface
{
    use Attributable;
}
```

### Configure attributes on Eloquent model

[](#configure-attributes-on-eloquent-model)

Add `$systemAttributes` on your entity to add attributes on code-level:

```
use \Module\Attribute\Contracts\AttributesInterface
use \Module\Attribute\Traits\Attributable

class Book extends Model implements AttributesInterface
{
    use Attributable;
    ...

    // Set systemAttributes to define EAV attributes
    protected $systemAttributes = [
        'isbn' => [
            'type' => 'input'
        ],
        'media' => [
            'type' => 'checkbox',
            'options' => [
                'audio-cd',
                'audio-book',
                'e-book',
            ]
        ]
    ];
}
```

#### Available SystemAttributes Parameters

[](#available-systemattributes-parameters)

**type** : String of input type (list below)

- `input` : input\[type=text\]
- `textarea` : teaxarea
- `radio` : input\[type=radio\]
- `checkbox` : input\[type=checkbox\]
- `select` : select
- `multiselect` : select\[multiple\]

**options** : Array of option keys

**has\_translatable\_values** : boolean

### About Laraplug

[](#about-laraplug)

LaraPlug is a opensource e-commerce project built on top of AsgardCMS.

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

[](#contributing)

We welcome any pull-requests or issues :)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

2990d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb11fb8b7cabfcca0fcf04d43fbaec7cb3da1b863a5ae1b287824e6fcf43c007?d=identicon)[darron1217](/maintainers/darron1217)

---

Top Contributors

[![darron1217](https://avatars.githubusercontent.com/u/8064923?v=4)](https://github.com/darron1217 "darron1217 (16 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laraplug-attribute-module/health.svg)

```
[![Health](https://phpackages.com/badges/laraplug-attribute-module/health.svg)](https://phpackages.com/packages/laraplug-attribute-module)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

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