Closed lipasite closed 5 years ago
Any Luck ?
Didn't use this package, but if there is a field in the database that showcases the last date a user has signed in you can create a calculation based on 'an active user is considered to have a date that's within 3 minutes of the update_at field' or something.
Like logic wise - perhaps similar to this:
public function getOnlineStatusAttribute(){
$timeout = 3; //3 minutes
if($this->session != null){
$now = Carbon::now();
$diff = $this->session->updated_at->diffInMinutes($now);
return ($diff <= $timeout) ? true : false;
}
}
Is it possible to get stats by current online users?