PHPackages                             astalpaert/laravel-blamable - 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. [Database &amp; ORM](/categories/database)
4. /
5. astalpaert/laravel-blamable

ActiveLibrary[Database &amp; ORM](/categories/database)

astalpaert/laravel-blamable
===========================

Laravel Eloquent models blamable

v2.0.0(11mo ago)131.8k↓40.2%5[1 issues](https://github.com/astalpaert/laravel-blamable/issues)[2 PRs](https://github.com/astalpaert/laravel-blamable/pulls)MITPHPPHP ^8.2CI passing

Since Mar 3Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/astalpaert/laravel-blamable)[ Packagist](https://packagist.org/packages/astalpaert/laravel-blamable)[ RSS](/packages/astalpaert-laravel-blamable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (12)Used By (0)

Laravel Blamable 👈
==================

[](#laravel-blamable-)

This package allow you to track who created, updated and deleted Eloquent models in Laravel.

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

[](#installation)

You can install this package via composer using:

```
composer require astalpaert/laravel-blamable
```

The package will automatically register itself.

Usage
-----

[](#usage)

### Implement Blamable fields

[](#implement-blamable-fields)

The package provides 2 convenient methods `addBlamableFields()` and `removeBlamableFields()` which you may use in your migrations to make sure that the database table has the required columns (`created_by`, `updated_by` and `deleted_by`).

```
    public function up()
    {
        Schema::table('dummy_models', function (Blueprint $table) {
            $table->addBlamableFields();
        });
    }

    public function down()
    {
        Schema::table('dummy_models', function (Blueprint $table) {
            $table->removeBlamableFields();
        });
    }
```

### Implement Blamable logic

[](#implement-blamable-logic)

You may then use the `Blamable` trait on the model.

```
use Astalpaert\LaravelBlamable\Traits\Blamable;
use Illuminate\Database\Eloquent\Model;

class DummyModel extends Model
{
    use Blamable;
    //use SoftDeletes;
}
```

Et voilà! The package will fill the blamable columns automatically after creating, updating and deleting the model.

Configuration
-------------

[](#configuration)

To publish the config file to `config/astalpaert-blamable.php` run:

```
php artisan vendor:publish --provider="Astalpaert\LaravelBlamable\Providers\BlameableServiceProvider"
```

### Implement User model

[](#implement-user-model)

By default, the `name` attribute of the authenticated User is used to fill the blamable column. This is configurable in the config under `attribute_name`:

```
return [
    'user' => [
        'attribute_name' => 'name',
    ],
];
```

You may also use an accessor in the model for more flexibility:

```
public function getNameAttribute(): string
{
    return "$this->first_name $this->last_name";
}
```

**Note**: The blamable fields are string columns, so make sure the name is a `string`.

### Implement default value

[](#implement-default-value)

By default, when there is no authenticated user, the value `SYSTEM` is used to fill the blamable column. This is configurable in the config under `default`:

```
return [
    'user' => [
        'default' => 'SYSTEM',
    ],
];
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~131 days

Recently: every ~166 days

Total

10

Last Release

352d ago

Major Versions

v0.4.0 → v1.0.02024-04-18

v1.0.2 → v2.0.02025-05-31

PHP version history (2 changes)v0.1.0PHP ^7.4|^8.0

v1.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51073?v=4)[Ignace Nyamagana Butera](/maintainers/nyamsprod)[@nyamsprod](https://github.com/nyamsprod)

![](https://www.gravatar.com/avatar/913c49cf2a71127998eb986a68d8dd81f3a9a96e5a4f9b063066a2b5c2a99a28?d=identicon)[Douglasdc3](/maintainers/Douglasdc3)

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

---

Top Contributors

[![astalpaert](https://avatars.githubusercontent.com/u/5843790?v=4)](https://github.com/astalpaert "astalpaert (22 commits)")[![Douglasdc3](https://avatars.githubusercontent.com/u/5066883?v=4)](https://github.com/Douglasdc3 "Douglasdc3 (6 commits)")[![nyamsprod](https://avatars.githubusercontent.com/u/51073?v=4)](https://github.com/nyamsprod "nyamsprod (3 commits)")[![huyby](https://avatars.githubusercontent.com/u/382155?v=4)](https://github.com/huyby "huyby (1 commits)")[![sebsobseb](https://avatars.githubusercontent.com/u/3526974?v=4)](https://github.com/sebsobseb "sebsobseb (1 commits)")

---

Tags

eloquentlaravellaraveleloquentBlameable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/astalpaert-laravel-blamable/health.svg)

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

###  Alternatives

[cviebrock/eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel

4.0k13.6M253](/packages/cviebrock-eloquent-sluggable)[silber/bouncer

Eloquent roles and abilities.

3.6k4.4M25](/packages/silber-bouncer)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[cybercog/laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

1.1k651.8k11](/packages/cybercog-laravel-ban)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)

PHPackages © 2026

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