PHPackages                             kamansoft/laravel-blame - 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. kamansoft/laravel-blame

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

kamansoft/laravel-blame
=======================

A tool to easily work with the updated\_by and created\_by fields on your laravel eloquent models

2.0.0(1y ago)122.6k4[2 PRs](https://github.com/kamansoft/laravel-blame/pulls)MITPHPPHP ^8.2CI passing

Since Jan 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/kamansoft/laravel-blame)[ Packagist](https://packagist.org/packages/kamansoft/laravel-blame)[ Docs](https://github.com/kamansoft/laravel-blame)[ RSS](/packages/kamansoft-laravel-blame/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (4)Dependencies (13)Versions (17)Used By (0)

laravel-blame
=============

[](#laravel-blame)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3c421e8a69f977b0d36e9fae3bdf5644167605bfd619cddbfca43e71e09047b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b616d616e736f66742f6c61726176656c2d626c616d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kamansoft/laravel-blame)[![GitHub Tests Action Status](https://camo.githubusercontent.com/da4c4eaa51315717c5656adfbd170cb31121a63cd0f150520947c281a10ff4e8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b616d616e736f66742f6c61726176656c2d626c616d652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/kamansoft/laravel-blame/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4fc2d030ef2ffcbffc9ff09b981f44b3db42622bf46a0703abc73669849064be/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b616d616e736f66742f6c61726176656c2d626c616d652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/kamansoft/laravel-blame/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/31858cdecc72a4783af63cc06c0c168e2df9c40d17d7a31a48dc8e36edb5656a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b616d616e736f66742f6c61726176656c2d626c616d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kamansoft/laravel-blame)

update\_by and created\_by fields in your laravel model ?
---------------------------------------------------------

[](#update_by-and-created_by-fields-in-your-laravel-model-)

This is a laravel package that will ease the usage of the normally called **created\_by** and **update\_by** extra fields used to stablish responsabilites on records persistance create or update events, with similar fashion as the "timestamp fields" on Eloquent's models, it automatically fills the fields with the primary key of the currently logged user or with a preconfigured system user id.

Requirements
------------

[](#requirements)

This package was build taking in mind that you use laravel with an [eloquent **user model class** as auth provider](https://laravel.com/docs/9.x/authentication#introduction). So before installing, you must make sure that your user eloquent model is set on the providers section of your auth config file like this:

```
//config/auth.php

'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => App\Models\User::class, // unsignedBigInteger(config('blame.created_by_field_name'))->default($system_user_id);
            $table->unsignedBigInteger(config('blame.updated_by_field_name'))->default($system_user_id);
        });
        Schema::table('some_table_name', function (Blueprint $table) {
            $table->unsignedBigInteger(config('blame.created_by_field_name'))->default(null)->change();
            $table->unsignedBigInteger(config('blame.updated_by_field_name'))->default(null)->change();
        });
        Schema::table('some_table_name', function (Blueprint $table) {
            $table->foreign(config('blame.created_by_field_name'))->references('id')->on('users');
            $table->foreign(config('blame.updated_by_field_name'))->references('id')->on('users');
        });
    }
```

### System User Command

[](#system-user-command)

When used with no param or arguments:

```
php artisan blame:set:systemuser
```

This command creates a new laravel user to be used when no user can be retrived with Auth::user().

When run with a value through the optional "--key" param:

```
php artisan blame:set:systemuser --key=some_user_id
```

The command will check if a user with that id exists, and if not, it will try to create one with that id.

In both cases, the command will set the created system user primary key or id in the project .env file as BLAME\_SYSTEM\_USER\_ID.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance68

Regular maintenance activity

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 56.9% 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 ~276 days

Total

4

Last Release

495d ago

Major Versions

1.0.11 → 2.0.02025-04-10

PHP version history (2 changes)1.0.0PHP ^8.1

2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6447cb1bda70832f7099dbf3655545ab44e55b7d0b5f0b29d707c481138f0c43?d=identicon)[kamansoft](/maintainers/kamansoft)

---

Top Contributors

[![lemyskaman](https://avatars.githubusercontent.com/u/4540813?v=4)](https://github.com/lemyskaman "lemyskaman (41 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (18 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")[![zenoandras](https://avatars.githubusercontent.com/u/127849614?v=4)](https://github.com/zenoandras "zenoandras (2 commits)")

---

Tags

laravelkamansoftlaravel-blame

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/kamansoft-laravel-blame/health.svg)

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

###  Alternatives

[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

214456.3k2](/packages/wnx-laravel-backup-restore)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

46273.9k](/packages/harris21-laravel-fuse)[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17562.4k](/packages/lacodix-laravel-model-filter)[giacomomasseron/laravel-models-generator

Generate Laravel models from an existing database

569.9k](/packages/giacomomasseron-laravel-models-generator)

PHPackages © 2026

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