Laravel Visitor is a good package to extract and access visitors' information such as browser, ip, device, etc.

In this package, you can recognize online users and determine if a user is online or not

laravel visitor package

Install

via composer

composer require shetabit/visitor

Configure

If you are using Laravel 5.5 or higher then you don't need to add the provider and alias.

# In your providers array.
'providers' => [
    ...
    Shetabit\Visitor\Provider\VisitorServiceProvider::class,
],

# In your aliases array.
'aliases' => [
    ...
    'Visitor' => Shetabit\Visitor\Facade\Visitor::class,
],

then, run the below commands to publish migrations and create tables

php artisan vendor:publish

php artisan migrate

Source Code

https://github.com/shetabit/visitor?utm_source=learninglaravel