PHPackages                             codiliateur/eloquent-model-userstamps - 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. codiliateur/eloquent-model-userstamps

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

codiliateur/eloquent-model-userstamps
=====================================

This package provides an Eloquent model trait to automatically maintain user stamps in columns (created\_by, updated\_by, deleted\_by) of your model.

v1.0.5(7mo ago)0113MITPHPPHP ^7.1|^8.0

Since Jul 2Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/codiliateur/eloquent-model-userstamps)[ Packagist](https://packagist.org/packages/codiliateur/eloquent-model-userstamps)[ Docs](https://github.com/codiliateur/eloquent-model-userstamps)[ RSS](/packages/codiliateur-eloquent-model-userstamps/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

eloquent-model-userstamps
=========================

[](#eloquent-model-userstamps)

Installing
----------

[](#installing)

This package can be installed using composer:

```
composer require codiliateur/eloquent-model-userstamps

```

Model trait
-----------

[](#model-trait)

Add trait `Codiliateur\Userstamps\Models\HasUserstamps` into your model.

```
class YourModel extends Model
{
    use Codiliateur\Userstamps\Models\HasUserstamps;
    ...
}

```

To customize userstamp column names, define constants `CREATED_BY`, `UPDATED_BY`, `DELETED_BY` in your specific model.

```
class YourModel extends Model
{
    use Codiliateur\Userstamps\Models\HasUserstamps;
    ...

    const CREATED_BY = 'creator_id';
    const UPDATED_BY = 'updater_id';
    const DELETED_BY = 'liquidator_id';

    ...
}

```

Migration helpers
-----------------

[](#migration-helpers)

This package automatically adds into `Blueprint` two helper methods `userstamps()` and `dropUserstamps()`

```
    // to add user stamp columns
    userstamps(bool $softDeletes = false, string $columnType = null, array $columnNames = null)

    // to drop user stamp columns
    dropUserstamps(bool $softDeletes = false, array $columnNames = null)

```

To add userstamp columns into your table add lines into `up()` of your migration.

For model without `SoftDeleting` trait

```
$table->userstamps();

```

or the same with first argument

```
$table->userstamps(false);  // the same

```

And for model that used `SoftDeleting` trait

```
$table->userstamps(true);

```

By default, added columns have `bigInteger` type.

To ***change column type***, you can put `smallInteger`, `integer`, `bigInteger` or `uuid` into second argument `$columnType`. For example:

```
$table->userstamps(false, 'uuid');

```

To ***customize column names***, you can put array of names into third argument `$columnNames`.

```
    $table->userstamps(false, null, [
        'creator_id',    // [0] instead of 'created_by'
        'updater_id',    // [1] instead of 'updated_by'
        'liquidator_id', // [2] instead of 'deleted_by'
    ]);

```

Don't forget add any arguments into `dropUserstams()` call.

Configuring package
-------------------

[](#configuring-package)

By default, for userstamp columns used names `created_by`, `updated_by` and `deleted_by`and these columns are type `bigInteger`. These column names and column type defined in package configuration file.

You can publish this configuration file into yor project. For this run command:

```
php artisan vendor:publish --provider="Codiliateur\Userstamps\UserstampsServiceProvider"

```

File `.\config\codiliateur\userstamps.php` will be published.

To change ***userstamp column's type*** use config option `column_type`.

For example:

```
'column_type' => 'uuid', // if user ID has 'uuid' type

```

There you can use `smallInteger`, `integer`, `bigInteger`, `uuid` values.

To change default ***userstamp column's names*** you must modify config option `columns`.

For example:

```
    'columns' => [
        'creator_id',    // [0] instead of 'created_by'
        'updater_id',    // [1] instead of 'updated_by'
        'liquidator_id', // [2] instead of 'deleted_by'
    ],

```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance65

Regular maintenance activity

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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 ~278 days

Total

4

Last Release

211d ago

### Community

Maintainers

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

---

Top Contributors

[![codiliateur](https://avatars.githubusercontent.com/u/101108311?v=4)](https://github.com/codiliateur "codiliateur (3 commits)")

---

Tags

laravelmodeleloquentusertimestampstampcodiliateuruserstamp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codiliateur-eloquent-model-userstamps/health.svg)

```
[![Health](https://phpackages.com/badges/codiliateur-eloquent-model-userstamps/health.svg)](https://phpackages.com/packages/codiliateur-eloquent-model-userstamps)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[qcod/laravel-imageup

Auto Image upload, resize and crop for Laravel eloquent model using Intervention image

775113.8k](/packages/qcod-laravel-imageup)[waad/laravel-model-metadata

A robust Laravel package for handling metadata with JSON casting, custom relation names, and advanced querying capabilities.

823.1k](/packages/waad-laravel-model-metadata)

PHPackages © 2026

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