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[4 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 1mo ago

READMEChangelog (4)Dependencies (13)Versions (14)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 94% of packages

Maintenance71

Regular maintenance activity

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 57.4% 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

397d 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 (39 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 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

[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spatie/laravel-model-flags

Add flags to Eloquent models

4301.1M1](/packages/spatie-laravel-model-flags)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[spatie/laravel-sql-commenter

Add comments to SQL queries made by Laravel

1931.4M1](/packages/spatie-laravel-sql-commenter)[spatie/laravel-deleted-models

Automatically copy deleted records to a separate table

409109.8k4](/packages/spatie-laravel-deleted-models)

PHPackages © 2026

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