PHPackages                             scolib/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. scolib/attributes

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

scolib/attributes
=================

Attributes Trait

v1.0.3(9y ago)17081MITPHPPHP ~5.6|~7.0

Since Jun 10Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ScoLib/attributes)[ Packagist](https://packagist.org/packages/scolib/attributes)[ Docs](https://github.com/ScoLib/attributes)[ RSS](/packages/scolib-attributes/feed)WikiDiscussions master Synced 2d ago

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

attributes
==========

[](#attributes)

[![StyleCI](https://camo.githubusercontent.com/b4f2065202b696dd9c060d3bda881b36edfe686177c033baffc1458d4e5edaed/68747470733a2f2f7374796c6563692e696f2f7265706f732f39333933383630392f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/93938609)[![Latest Version on Packagist](https://camo.githubusercontent.com/7ce0ea776a81831004edff4d43f17757b3cb59df57de3ae3dabef01c55ccec07/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f53636f4c69622f617474726962757465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ScoLib/attributes)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/ef1efd434f969b14e4c599abb4d12e7d68d830528e01eb23608f079e7aed4719/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f53636f4c69622f617474726962757465732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ScoLib/attributes)[![Coverage Status](https://camo.githubusercontent.com/ea44b751cd02bc3191e5b27ea1ff8387fdce4bb9346d5bdc6d6e7326d3fe299f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f53636f4c69622f617474726962757465732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ScoLib/attributes/code-structure)[![Quality Score](https://camo.githubusercontent.com/45d4897dd4d0560a798fe5d3ea4b30b8d346d5c4b0e0c6207663668b43279426/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f53636f4c69622f617474726962757465732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ScoLib/attributes)[![Total Downloads](https://camo.githubusercontent.com/e9bcf69f80300d99b5a04ff34d1ecc1af62f5ef9e8bf9c4b5947c21b9ca8a3f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f53636f4c69622f617474726962757465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ScoLib/attributes)

Install
-------

[](#install)

Via Composer

```
$ composer require scolib/attributes
```

Usage
-----

[](#usage)

```
use Sco\Attributes\HasAttributesTrait;

class Demo
{
    use HasAttributesTrait;
｝
```

### Method

[](#method)

```
/**
 * Get the specified log value.
 *
 * @param null|string $key
 * @param mixed       $default
 *
 * @return mixed
 */
public function getAttribute($key = null, $default = null)

/**
 * Set a given log value.
 *
 * @param array|string $key
 * @param mixed        $value
 *
 * @return bool
 */
public function setAttribute($key, $value = null)

/**
 * @param  string|int $key
 *
 * @return bool
 */
public function existsAttribute($key)

/**
 * @param  string|array $keys
 *
 * @return bool
 */
public function hasAttribute($keys)
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [klgd](https://github.com/klgd)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3305d ago

### Community

Maintainers

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

---

Top Contributors

[![klgd](https://avatars.githubusercontent.com/u/8554422?v=4)](https://github.com/klgd "klgd (9 commits)")

---

Tags

attributeslaravelscolibtraitattributesScoLib

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/scolib-attributes/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M276](/packages/illuminate-pipeline)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)[illuminate/redis

The Illuminate Redis package.

8314.6M369](/packages/illuminate-redis)

PHPackages © 2026

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