Looking to hire Laravel developers? Try LaraJobs

laravel-created-by maintained by hyperlink

Description
Annoyed by writing the created by foreign user id for every model? Use our blueprint function instead
Author
Last update
2026/01/12 20:28 (dev-dependabot/github_actions/dependabot/fetch-metadata-2.5.0)
License
Downloads
142

Comments
comments powered by Disqus

laravel-created-by

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Annoyed by writing the created by foreign user id for every model? Use our blueprint function instead

Installation

You can install the package via composer:

composer require hyperlink/laravel-created-by

Usage

Schema::create('foo', function (Blueprint $table) {
    $table->id();
    $table->createdBy();
    $table->updatedBy();
    $table->deletedBy();
    $table->restoredBy();
    $table->timestamps();
    $table->softDeletes();
    $table->restoredAt();
});
<?php

namespace App\Models;

use Hyperlink\CreatedBy\WithCreatedBy;
use Illuminate\Database\Eloquent\Model;

class Foo extends Model
{
    use WithCreatedBy;
    use WithUpdatedBy;
    use WithDeletedBy;
    use WithRestoredBy;
    use WithRestoredAt;
}

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.