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

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

dfware/ar-softdelete
====================

Provides support for ActiveRecord soft delete in Yii2

1.0.0(2y ago)093BSD-3-ClausePHP

Since Sep 27Pushed 2y agoCompare

[ Source](https://github.com/dfware/ar-softdelete)[ Packagist](https://packagist.org/packages/dfware/ar-softdelete)[ GitHub Sponsors](https://github.com/klimov-paul)[ Patreon](https://www.patreon.com/klimov_paul)[ RSS](/packages/dfware-ar-softdelete/feed)WikiDiscussions master Synced 1mo ago

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

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

[](#installation)

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

Either run

```
composer require dfware/ar-softdelete

```

or add

```
"dfware/ar-softdelete": "*"
```

to the require section of your composer.json.

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 \[\[\\yii2tech\\ar\\softdelete\\SoftDeleteBehavior\]\] ActiveRecord behavior for such solution support in Yii2. You may attach it to your model class in the following way:

```
