custom-d / laravel-legacy-soft-deletes
允许我们在 Laravel 中使用旧版软删除功能,以处理我们的区域模块
v1.2.0
2021-06-08 04:24 UTC
Requires
- php: ^7.2
- illuminate/support: ^6.0|^7.0|^8.0
Requires (Dev)
- orchestra/testbench: ^4.0|^5.0|^6.0
- phpunit/phpunit: ^8.0|^9.0
This package is auto-updated.
Last update: 2024-09-08 11:20:30 UTC
README
允许使用状态(枚举 / 整数 / 字符串)列来跟踪记录是否已软删除的包。
安装
您可以通过 composer 安装此包
composer require custom-d/laravel-legacy-soft-deletes
使用
使用以下新行更新您的模型
import CustomD\LaravelLegacySoftDeletes\LegacySoftDeletes;
class xxx extends Model
{
use LegacySoftDeletes;
const STATUS_COLUMN = 'status' // defaults to status if not set
const DELETED_VALUE = 'deleted'; //defaults to deleted if not set
const RESTORED_VALUE ='active'; // defaults to active if not set
测试
composer test
变更日志
请参阅 CHANGELOG 了解最近更改的详细信息。
贡献
请参阅 CONTRIBUTING 了解详细信息。
安全
如果您发现任何与安全相关的问题,请通过 craig.smith@customd.com 发送电子邮件,而不是使用问题跟踪器。
致谢
许可证
MIT 许可证(MIT)。有关更多信息,请参阅 许可证文件。