PHPackages                             machour/yii2-softdelete-trait - 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. machour/yii2-softdelete-trait

ActiveYii2-extension

machour/yii2-softdelete-trait
=============================

This extension allow you to soft delete your ActiveRecord entities

1.0.0(10y ago)012.4k2MITPHP

Since Nov 20Pushed 10y agoCompare

[ Source](https://github.com/machour/yii2-softdelete-trait)[ Packagist](https://packagist.org/packages/machour/yii2-softdelete-trait)[ RSS](/packages/machour-yii2-softdelete-trait/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

SoftDelete trait for Yii2
=========================

[](#softdelete-trait-for-yii2)

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

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

[](#installation)

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

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.

Configuration
-------------

[](#configuration)

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';
    }

}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3827d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/50430982793b695a5a9a886a81b976606c71062b49cf38c12509801b1845b1b2?d=identicon)[machour](/maintainers/machour)

---

Top Contributors

[![machour](https://avatars.githubusercontent.com/u/304450?v=4)](https://github.com/machour "machour (3 commits)")

---

Tags

traitextensionBehavioryiisoftdelete

### Embed Badge

![Health badge](/badges/machour-yii2-softdelete-trait/health.svg)

```
[![Health](https://phpackages.com/badges/machour-yii2-softdelete-trait/health.svg)](https://phpackages.com/packages/machour-yii2-softdelete-trait)
```

###  Alternatives

[sjaakp/yii2-sortable-behavior

Sort ActiveRecords and related records in Yii2.

36144.7k](/packages/sjaakp-yii2-sortable-behavior)[sjaakp/yii2-taggable

Manage tags of ActiveRecord in Yii2.

3030.6k](/packages/sjaakp-yii2-taggable)[nanson/yii2-postgis

Yii2-extension to work with postgis data

1851.6k](/packages/nanson-yii2-postgis)[sjaakp/yii2-illustrated-behavior

ActiveRecord Behavior with associated Widget for Yii2.

423.1k](/packages/sjaakp-yii2-illustrated-behavior)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
