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.4k↑19%1MITPHPPHP &gt;=5.5.9CI failing

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 2d 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

37

—

LowBetter than 81% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity28

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

725d 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://avatars.githubusercontent.com/u/66117?v=4)[Aaron Rubin](/maintainers/Arkitecht)[@Arkitecht](https://github.com/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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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