PHPackages                             arkitecht/laravel-attributions - 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. arkitecht/laravel-attributions

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

arkitecht/laravel-attributions
==============================

Laravel 5/6/7/8/9/10 - Track attributions (model creator / updater)

5.2(1y ago)413.2k↓50%1MITPHPPHP &gt;=5.5.9

Since Mar 13Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Arkitecht/laravel-attributions)[ Packagist](https://packagist.org/packages/arkitecht/laravel-attributions)[ RSS](/packages/arkitecht-laravel-attributions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (13)Used By (0)

Laravel Attributions
====================

[](#laravel-attributions)

[![Laravel 5.1](https://camo.githubusercontent.com/05076f1468adbd2ff88c746e1d499486fe3755747a047b2f42949a583c4884b2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e312d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Source](https://camo.githubusercontent.com/a846ebec3e2396b6195c86946538eb600eae53750018d796e9a16740731b5bb0/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d61726b6974656368742f6174747269627574696f6e732d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/arkitecht/laravel-attributions)[![License](https://camo.githubusercontent.com/30597ff9a350144f03bffdd9183e16468e0b3ca1193e1d08591d992622738d55/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://tldrlegal.com/license/mit-license)

Easily attribute the creator / last updater of a model in your database.

Designed to work like (and alongside) $table-&gt;timestamps() in your Laravel migrations, Attributions introduces $table-&gt;attributions(). This will add creator\_id and updater\_id columns to your table to track the user that created and updated the model respectively. By default this uses the Laravel 5.1 predefined users table, but can be customized to reference any table and key combination.

Quick Installation
------------------

[](#quick-installation)

You can install the package most easily through composer

#### Laravel 5.1.x

[](#laravel-51x)

```
composer require arkitecht/laravel-attributions

```

Schema Blueprint and Facades
----------------------------

[](#schema-blueprint-and-facades)

Once this operation is complete, you can update the Schema Facade to point to our drop-in replacement, which uses our Blueprint extension class to add the attributions.

#### Laravel 5.1.x

[](#laravel-51x-1)

##### Facade (in config/app.php)

[](#facade-in-configappphp)

'Schema' =&gt; Illuminate\\Support\\Facades\\Schema::class,

'Schema' =&gt; Arkitecht\\Attributions\\Facades\\Schema::class,

You can also manually use the attributions builder, without overwriting the Facade like so:

```
use Arkitecht\Attributions\Database\Schema\Blueprint;

/**
 * Run the migrations.
 *
 * @return void
 */
public function up()
{
    $schema =  DB::getSchemaBuilder();

    $schema->blueprintResolver(function($table, $callback) {
        return new Blueprint($table, $callback);
    });

    $schema->create('tests', function (Blueprint $table) {
        $table->increments('id');
        $table->timestamps();
        $table->attributions();
    });
}
```

Using it in your migrations
---------------------------

[](#using-it-in-your-migrations)

To have your migration add the attribution columns, just call the Blueprint::attributions method.

```
class CreateTestsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tests', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
            $table->attributions();
        });
    }

	...

}
```

You can also have it reference an alternate table (from users) or key (from id).

```
class CreateTestsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tests', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
            $table->attributions('employees','employee_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('tests');
    }
}
```

Using it in your model
----------------------

[](#using-it-in-your-model)

To have the creator and updater automagically updated when a model is created and updated, just use the Attributions trait in your model.

```

```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

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

Recently: every ~152 days

Total

12

Last Release

672d ago

Major Versions

1.3 → 2.02020-08-10

2.0 → 3.02020-10-05

3.0 → 4.02022-11-04

4.2 → 5.02023-03-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/4005803a73675789dc74ade6a96286abe9ae3cb4f6bc3cb6e70c19f129b7fcf4?d=identicon)[Arkitecht](/maintainers/Arkitecht)

---

Top Contributors

[![Arkitecht](https://avatars.githubusercontent.com/u/66117?v=4)](https://github.com/Arkitecht "Arkitecht (24 commits)")

---

Tags

laravelmodelcreditattributionsarkitecht

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arkitecht-laravel-attributions/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[glhd/special

1929.4k](/packages/glhd-special)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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