tugmaks / yii2-lastseen
Automatically fills last activity time for current user
Installs: 264
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2025-04-24 22:02:18 UTC
README
Automatically fills last activity time for current user
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist tugmaks/yii2-lastseen "0.2"
or add
"tugmaks/yii2-lastseen": "0.3"
to the require section of your composer.json
file.
Usage
Once the behavior is installed, simply use it in your code by adding this lines to application config:
'as lastSeen'=>[ 'class'=>'tugmaks\behaviors\LastSeen\LastSeenBehavior', 'lastSeenAttribute'=>'last_seen' // attribute that stores last seen time in user table // uncomment this line if you store last seen as datetime, by default beahavior saves as unixtime //'value'=> new \yii\db\Expression('NOW()'), ]```