PHPackages                             n7olkachev/laravel-accessors - 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. n7olkachev/laravel-accessors

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

n7olkachev/laravel-accessors
============================

Use Laravel-like accessors in your classes

v1.0.0(8y ago)10652MITPHPPHP ^7.0

Since Aug 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/n7olkachev/laravel-accessors)[ Packagist](https://packagist.org/packages/n7olkachev/laravel-accessors)[ Docs](https://github.com/n7olkachev/laravel-accessors)[ RSS](/packages/n7olkachev-laravel-accessors/feed)WikiDiscussions master Synced 2mo ago

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

Laravel Accessors
=================

[](#laravel-accessors)

[![](https://camo.githubusercontent.com/bf145b0037e1d79cc706e3e3d9004c734fb81733ffe45a2e4e431ddb91ed79dd/68747470733a2f2f7765627365637265742e62792f696d616765732f6c6f676f2d6769746875622e706e67)](https://websecret.by)

[![Code quality](https://camo.githubusercontent.com/fad8ef28c8ff196a54a6c05e19ca5912985373319de18f6c74558b0ea5590666/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6e376f6c6b61636865762f6c61726176656c2d6163636573736f72732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/n7olkachev/laravel-accessors/)[![Licence](https://camo.githubusercontent.com/5c259d53209deb7f27aeed071c9d48611c9127bd5e063bb2a5a47fffdb9b99da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e376f6c6b61636865762f6c61726176656c2d6163636573736f72732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/n7olkachev/laravel-accessors)[![Build Status](https://camo.githubusercontent.com/88cf5100e55fbcdc27cf950d6a19869a1376988578341672dc54fce45742da4d/68747470733a2f2f7472617669732d63692e6f72672f6e376f6c6b61636865762f6c61726176656c2d6163636573736f72732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/n7olkachev/laravel-accessors)

This package gives you ability to use `getFooBarAttribute` and `setFooBarAttribute` methods in your classes with one trait.

Examples
--------

[](#examples)

```
class User
{
    use Accessors;

    protected $name;

    public function __construct($name)
    {
        $this->name = $name;
    }

    public function getNameAttribute()
    {
        return $this->name;
    }

    public function setNameAttribute($name)
    {
        $this->name = $name;
    }
}

$user = new User('Nick');
echo $user->name; // calls getNameAttribute
$user->name = 'Not Nick' // calls setNameAttribute
```

Instalation
-----------

[](#instalation)

```
$ composer require n7olkachev/laravel-accessors
```

In your class:

```
class User
{
    use Accessors;
}
```

Testing
-------

[](#testing)

```
$ composer test
```

Credits
-------

[](#credits)

- [Nikita Tolkachev](https://github.com/n7olkachev)

Sponsored by
------------

[](#sponsored-by)

Web agency based in Minsk, Belarus

License
-------

[](#license)

The MIT License (MIT)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3179d ago

### Community

Maintainers

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

---

Top Contributors

[![n7olkachev](https://avatars.githubusercontent.com/u/3993345?v=4)](https://github.com/n7olkachev "n7olkachev (3 commits)")

---

Tags

phplaravelaccessorswebsecret

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/n7olkachev-laravel-accessors/health.svg)

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

###  Alternatives

[amranidev/laracombee

Recommendation system for laravel

11636.7k1](/packages/amranidev-laracombee)[salmanzafar/laravel-geocode

A Laravel Library to find Lat and Long of a given Specific Address

153.9k](/packages/salmanzafar-laravel-geocode)[wujunze/money-wrapper

MoneyPHP Wrapper

113.8k](/packages/wujunze-money-wrapper)

PHPackages © 2026

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