PHPackages                             richard8768/hyperf-softdelete - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. richard8768/hyperf-softdelete

ActiveLibrary[Database &amp; ORM](/categories/database)

richard8768/hyperf-softdelete
=============================

Hyperf softdelete

0.3(1mo ago)02MITPHP &gt;=8.2

Since May 8Compare

[ Source](https://github.com/richard8768/hyperf-softdelete)[ Packagist](https://packagist.org/packages/richard8768/hyperf-softdelete)[ RSS](/packages/richard8768-hyperf-softdelete/feed)WikiDiscussions Synced 3w ago

READMEChangelog (3)Dependencies (18)Versions (5)Used By (0)

richard8768/hyperf-softdelete
=============================

[](#richard8768hyperf-softdelete)

Hyperf Soft Delete Extension: Custom Soft Delete Fields and Deletion Values for Hyperf. Facilitates the creation of a unique composite index containing Soft Delete Fields.

Hyperf 软删除扩展：为 Hyperf 自定义软删除字段及删除标识值 便于创建包含软删除字段的唯一复合索引

> QQ:444626008

Default configuration 默认配置
--------------------------

[](#default-configuration-默认配置)

```
const DELETED_AT = 'deleted_at';//Soft Delete Fields,the default value is deleted_at 软删除字段 默认值 deleted_at
const UN_DELETED_VALUE = 0;//undeleted value for the soft delete field,the default value is 0 软删除字段数据未删除时的值 默认值 0
const TIMESTAMP_TYPE = 'seconds';//only support seconds milliseconds nanoseconds,nanoseconds achieves functionality through hrtime (true) 时间戳类型 秒 微妙 纳秒(通过hrtime(true)实现)

DDL for Soft Delete Field `deleted_at` 软删除字段`deleted_at`的DDL
`deleted_at` int NOT NULL DEFAULT '0' //only support seconds 只支持秒
`deleted_at` bigint NOT NULL DEFAULT '0'//support seconds milliseconds nanoseconds 支持秒 微妙 纳秒

```

install 安装
----------

[](#install-安装)

```
composer require richard8768/hyperf-softdelete
```

Useage 使用
---------

[](#useage-使用)

```
Supposing your model is MemberAddress.php 假设你的模型是 MemberAddress.php
here is the config code 配置如下
