PHPackages                             thebachtiarz/laravel-additional-attribute-v1 - 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. thebachtiarz/laravel-additional-attribute-v1

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

thebachtiarz/laravel-additional-attribute-v1
============================================

A Simple Additional Attribute for Laravel Project v1

2.0.8(3y ago)115MITPHPPHP ^8.0

Since Feb 1Pushed 3y ago1 watchersCompare

[ Source](https://github.com/thebachtiarz/laravel-additional-attribute-v1)[ Packagist](https://packagist.org/packages/thebachtiarz/laravel-additional-attribute-v1)[ Docs](https://github.com/thebachtiarz/laravel-additional-attribute-v1)[ RSS](/packages/thebachtiarz-laravel-additional-attribute-v1/feed)WikiDiscussions master Synced 1mo ago

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

Laravel Additional Attribute v1
===============================

[](#laravel-additional-attribute-v1)

### A Simple Additional Attribute for Laravel Project v1

[](#a-simple-additional-attribute-for-laravel-project-v1)

---

Requires
--------

[](#requires)

- [laravel/framework](https://github.com/laravel/framework/) v9.x
- [thebachtiarz/laravel-toolkit-v1](https://github.com/thebachtiarz/laravel-toolkit-v1/) v2.x

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

[](#installation)

- composer config (only if you have access)

```
composer config repositories.thebachtiarz/laravel-additional-attribute-v1 git git@github.com:thebachtiarz/laravel-additional-attribute-v1.git
```

- install repository

```
composer require thebachtiarz/laravel-additional-attribute-v1
```

- vendor publish

```
php artisan vendor:publish --provider="TheBachtiarz\AdditionalAttribute\ServiceProvider"
```

- database migration

```
php artisan migrate
```

Implementation
--------------

[](#implementation)

- add Class Trait Service below here into Model.

```
use \TheBachtiarz\AdditionalAttribute\Service\AdditionalAttributes;
```

- Example:

```
setAttr('attrName', 'attrValue');
```

- ### Get Attribute By Name.

    [](#get-attribute-by-name-)

Get attribute in model by attribute name.

```
/**
 * Get attribute by name
 *
 * @param string $attrName
 * @param boolean $map default: false
 * @return mixed
 */
public function getAttr(string $attrName, bool $map = false): mixed;
```

```
App\Models\User::find(1)->getAttr('attrName', false);
```

- ### Get Attribute By Name (Only value).

    [](#get-attribute-by-name-only-value-)

Get attribute in model only value by attribute name.

```
/**
 * Get attribute by name.
 * Get only value.
 *
 * @param string $attrName
 * @param boolean $withKey default: false
 * @return mixed
 */
public function getAttrValue(string $attrName, bool $withKey = false): mixed;
```

```
App\Models\User::find(1)->getAttrValue('attrName', false);
```

- ### Get All Attributes.

    [](#get-all-attributes-)

Get all attribute(s) in model.

```
/**
 * Get all attribute belongs to model
 *
 * @param boolean $map default: false
 * @return array|null
 */
public function getAttrs(bool $map = false): ?array;
```

```
App\Models\User::find(1)->getAttrs(false);
```

- ### Search By Attributes.

    [](#search-by-attributes-)

Search value by attribute name.

```
/**
 * Search value by attribute name
 *
 * @param string $attrName
 * @param string $valueToSearch
 * @param boolean $map
 * @return array
 */
public static function searchValueByAttr(string $attrName, string $valueToSearch, bool $map = false): array;
```

```
App\Models\User::searchValueByAttr('attributeName', 'valueToSearch', false);
```

---

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Recently: every ~35 days

Total

12

Last Release

1294d ago

Major Versions

1.0.3 → 2.0.02022-02-28

PHP version history (2 changes)1.0.0PHP ^7.4|^8.0

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/157bc70c9a4b1673a73b8e93d03a066987b10fa005c8e63a30f3214e011a2557?d=identicon)[thebachtiarz](/maintainers/thebachtiarz)

---

Top Contributors

[![thebachtiarz](https://avatars.githubusercontent.com/u/17689101?v=4)](https://github.com/thebachtiarz "thebachtiarz (17 commits)")

---

Tags

laravelattributethebachtiarz

### Embed Badge

![Health badge](/badges/thebachtiarz-laravel-additional-attribute-v1/health.svg)

```
[![Health](https://phpackages.com/badges/thebachtiarz-laravel-additional-attribute-v1/health.svg)](https://phpackages.com/packages/thebachtiarz-laravel-additional-attribute-v1)
```

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)[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)[forxer/laravel-gravatar

A library providing easy gravatar integration in a Laravel project.

4235.6k](/packages/forxer-laravel-gravatar)

PHPackages © 2026

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