Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.63 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.63 KB

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.