
use App\Models\UserStatus;

trait UserStatusTraits{

	public function setStatusToOnline($userId)
	{
		if(UserStatus::where('user_id',$userId)->count()==1)
		{
			UserStatus::where('user_id',$userId)->update(['online'=>true]);
			return;
		}
		UserStatus::create(['user_id'=>$userId,'online'=>true]);