Annoyed by writing the created by foreign user id for every model? Use our blueprint function instead
You can install the package via composer:
composer require hyperlink/laravel-created-by
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;
}
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.