shetabit/visitor

How to set "visitor_type" and "visitor_id" when adding visit log

douglas168 opened this issue · 1 comments

Detailed description

The Laravel 8 project uses two auth models ( User, Admin).

In the Login Controller and after authenticated successfully, I can use the following to add a visit log to "shetabit_visits" table.

visitor()->visit();

Yet, the "visitor_type" and "visitor_id" are blank.

How can I include "visitor_type" (user or admin) and "visitor_id" (login name) to the added log?

Thanks

in your user models (User and Admin) use Shetabit\Visitor\Traits\Visitor and Shetabit\Visitor\Traits\CanVisit traits