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

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

dbt/blame
=========

3.0.0(3y ago)02973MITPHPPHP ^8.0.2CI failing

Since Jun 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/DeBoerTool/blame)[ Packagist](https://packagist.org/packages/dbt/blame)[ RSS](/packages/dbt-blame/feed)WikiDiscussions trunk Synced 6d ago

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

Automatic `created_by`, `updated_by`, and `deleted_by` model attributes.
========================================================================

[](#automatic-created_by-updated_by-and-deleted_by-model-attributes)

Getting Started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

This package requires PHP 7.1.3 or higher, `illuminate/support@^5.7`, and `illuminate/database@^5.7`.

### Installing

[](#installing)

Via Composer:

```
composer require dbt/blame
```

### Testing

[](#testing)

Run:

```
composer test
```

Usage
-----

[](#usage)

Publish the `blame.php` configuration file with the `php artisan vendor:publish` command, or copy the file from this repository. The service provider should be auto-discovered.

In your configuration file, add the models you wish to observe:

```
'models' => [
    App\MyModel::class
],
```

You can also use the config file to customize the column names and swap out the observer if you wish.

`deleted_at` will only be written if the given model uses Soft Deletes.

### Default user id

[](#default-user-id)

If you're mutating models in non-authenticated contexts and you wish to write a default user id on create, update, or delete, you can set the `blame.user.default_id` config key to an integer. By default this key is null.

### Manual override

[](#manual-override)

If you set a value manually (eg `$model->created_at = 1`), this value will be written to the database instead of the automatic value. This is useful for contexts where you don't have an authenticated user (eg when creating models via the console) and you still wish to write an id.

### Model trait

[](#model-trait)

You'll probably want relations, in which case you can use `BlameTrait`, which provides `created_by`, `updated_by` and `deleted_by` relations. You can of course opt not to use this trait and define your own relation methods however you like.

### Blueprint macro

[](#blueprint-macro)

There is also a `Blueprint` macro, `blameColumns` that you can use in your migrations:

```
Schema::create('myTable', function (Blueprint $table) {
    $table->blameColumns();
}
```

This macro will create the columns specified in your `blame.php` config file.

### License

[](#license)

MIT. Do as you wish.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 95% 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 ~194 days

Recently: every ~291 days

Total

7

Last Release

1407d ago

Major Versions

1.3.0 → 2.0.02021-08-23

2.0.0 → 3.0.02022-08-26

PHP version history (3 changes)1.0.0PHP &gt;=7.1.3

2.0.0PHP ^8.0

3.0.0PHP ^8.0.2

### Community

Maintainers

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

---

Top Contributors

[![danielsdeboer](https://avatars.githubusercontent.com/u/13170241?v=4)](https://github.com/danielsdeboer "danielsdeboer (19 commits)")[![justsanjit](https://avatars.githubusercontent.com/u/9400880?v=4)](https://github.com/justsanjit "justsanjit (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[lemaur/eloquent-publishing

218.1k1](/packages/lemaur-eloquent-publishing)[laravel-liberu/laravel-gedcom

A package that converts gedcom files to Eloquent models

782.5k1](/packages/laravel-liberu-laravel-gedcom)

PHPackages © 2026

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