hyperlink / laravel-created-by
每次为每个模型编写创建者的外键ID都感到烦恼吗?使用我们的蓝图功能代替
v1.0.2
2023-01-19 12:44 UTC
Requires
- php: ^8.1
- illuminate/contracts: ^9.0
- spatie/laravel-package-tools: ^1.13.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-08 15:54:15 UTC
README
每次为每个模型编写创建者的外键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)。请参阅 许可证文件 以获取更多信息。