Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login and logout #6

Closed
larbous opened this issue Sep 28, 2015 · 4 comments
Closed

Login and logout #6

larbous opened this issue Sep 28, 2015 · 4 comments

Comments

@larbous
Copy link

larbous commented Sep 28, 2015

How to track users when they did a login or logout?
Thanks

@anteriovieira
Copy link
Member

Hello @lsobral ,
You can add last_access column and automatically from the laravel-auditing will track your changes.

@anteriovieira
Copy link
Member

Maybe it was not very clear in my answer.
The idea is to register the column last_access the date and time the user accessed the system in this way it will be recorded as a log. To view the log you can customize the message as follows:

    public static $logCustomFields = [
         'last_access' => 'Last access on {elapsed_time}.'
    ];

@larbous
Copy link
Author

larbous commented Sep 28, 2015

Hello @anteriovieira

I created a Handler to work at login time by updating the date of last access and the User model and put your code snippet. The log has been successfully created, but without "Last access on ..." string. In any case it worked. Thank you.

@anteriovieira
Copy link
Member

Hello, @isobral detail this last problem you had.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants