hyperlink/laravel-created-by

每次为每个模型编写创建者的外键ID都感到烦恼吗?使用我们的蓝图功能代替

v1.0.2 2023-01-19 12:44 UTC

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

每次为每个模型编写创建者的外键ID都感到烦恼吗?使用我们的蓝图功能代替

安装

您可以通过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;
}

变更日志

请参阅 CHANGELOG 以获取有关最近更改的更多信息。

致谢

许可证

MIT许可证(MIT)。请参阅 许可证文件 以获取更多信息。