jc-it/yii2-timestamp-behavior

Timestamp behavior for Yii2 that includes deleted at.

v1.0.0 2019-06-10 12:01 UTC

This package is not auto-updated.

Last update: 2024-12-14 12:07:58 UTC


README

This extension provides a package that extends the Timestamp behavior with a deleted_at field.

$ composer require jc-it/yii2-timestamp-behavior

or add

"jc-it/yii2-timestamp-behavior": "^<latest version>"

to the require section of your composer.json file.

Configuration

In a model:

/**
 * @return array
 */
public function behaviors(): array
{
    return ArrayHelper::merge(
        parent::behaviors(),
        [
            TimestampBehavior::class => [
                'class' => TimestampBehavior::class
            ],
        ]
    );
}

For more detailed configuration, see Timestamp behavior.

Credits

License

The MIT License (MIT). Please see LICENSE for more information.