A
A
Anton2016-06-05 20:54:27
Laravel
Anton, 2016-06-05 20:54:27

How to create a list of online users?

Good evening!
I want to make it so that user profiles show information about when he last visited the site. Example: "Was online: June 4 at 16:48". It is necessary, probably, to insert a request to update the visiting time somewhere.
Can you please tell me how to implement this in the Laravel framework?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WebDev, 2016-06-05
@Yadalay

Create a middleware that will update a field in the database on every request. Or update this field with each authorization. See what you need.

V
Vladimir Grabko, 2016-06-05
@VGrabko

Advise here to you in a DB at each request to update. Funny.
Make a ws server. When a connection is opened with him then the user is online. And when the connection is closed, we update the value in the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question