Skip to content

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

License

Notifications You must be signed in to change notification settings

hyperlinkgroup/laravel-created-by

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages