PHPackages                             yii2dev/ar-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. yii2dev/ar-softdelete

ActiveYii2-extension[Database &amp; ORM](/categories/database)

yii2dev/ar-softdelete
=====================

Provides support for ActiveRecord soft delete in Yii2

2.0.0(3y ago)114.3k↓36.8%BSD-3-ClausePHPPHP ^8.1

Since Sep 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/yii2Dev/ar-softdelete)[ Packagist](https://packagist.org/packages/yii2dev/ar-softdelete)[ RSS](/packages/yii2dev-ar-softdelete/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

ActiveRecord Soft Delete Extension for Yii2
===========================================

[](#activerecord-soft-delete-extension-for-yii2)

This extension provides support for ActiveRecord soft delete.

For license information check the [LICENSE](LICENSE.md)-file.

Forked from:

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist yii2dev/ar-softdelete

```

Usage
-----

[](#usage)

This extension provides support for so called "soft" deletion of the ActiveRecord, which means record is not deleted from database, but marked with some flag or status, which indicates it is no longer active, instead.

This extension provides \[\[\\yii2dev\\ar\\softdelete\\SoftDeleteBehavior\]\] ActiveRecord behavior for such solution support in Yii2. You may attach it to your model class in the following way:

```
