neuecommerce/visible-records
Composer 安装命令:
composer require neuecommerce/visible-records
包简介
Handle visibility state on your Laravel Eloquent model records.
README 文档
README
An Activity Logger for Laravel Eloquent models.
Installation
- Install the package via Composer:
composer require neuecommerce/visible-records
Implementation
Automatic
Implementing the Visible Records package on your Eloquent models, is quite simple and can be done in 3 just simple steps:
-
Implement the
NeueCommerce\VisibleRecords\HasVisibilityInterfaceinterface on your model(s). -
Implement the
NeueCommerce\VisibleRecords\HasVisibilitytrait on your model(s). -
Create a database migration that adds the
visibile_atnullable timestamp column to your model(s) table.
Here's an example of a model with the proper implementation:
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use NeueCommerce\VisibleRecords\HasVisibilityInterface; use NeueCommerce\VisibleRecords\HasVisibility; class Product extends Model implements HasVisibilityInterface { use HasVisibility; public $table = 'products'; }
Here's an example of a database migration:
<?php ...
Usage
...
Testing
composer test
Contributing
Thank you for your interest. Here are some of the many ways to contribute.
- Check out our contributing guide
- Look at our code of conduct
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 326
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-10