This extension allow you to soft delete your ActiveRecord entities

Installs: 11 485

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Open Issues: 0


1.0.0 2015-11-20 09:41 UTC

This package is auto-updated.

Last update: 2020-02-15 17:09:50 UTC


This trait allow you to store any attribute change happening to an ActiveRecord


The preferred way to install this extension is through composer.

Either run

php composer.phar require machour/yii2-softdelete-trait "*"

or add

"machour/yii2-softdelete-trait": "*"

to the require section of your composer.json file.


You need to configure your model as follows:

class Article extends ActiveRecord
    use \machour\yii2\behaviors\SoftDeleteTrait;

    static public function getDeletedAtAttribute() 
        return self::tableName() . '.deleted_at';