Skip to content

Recognize online visitors

Compare
Choose a tag to compare
@khanzadimahdi khanzadimahdi released this 15 Oct 10:05
· 47 commits to master since this release

Retrieve and Determine Online users

use Shetabit\Visitor\Traits\Visitor in your User class at first.

then you can retrieve online users which are instance of User class and determine if a user is online.

visitor()->onlineVisitors(User::class); // returns collection of online users
User::online()->get(); // another way

visitor()->isOnline($user); // determines if the given user is online
$user->isOnline(); // another way