php - Count logged in users in real time Laravel -


i think laravel solves problem well, extend question little bit.

is possible in laravel show how many users logged in, in real time?

like if 10 users logged counter should show 10 users logged in. shown ten users , in real time.

so if users logs out, counter should decrease.

the approach used after attempting login, can increment counter of 1 of column in db. can use table, logged in table.

when users logged out, decrement counter deleting auth::id of user , count reduced.

but want try in real time, how possible laravel itself??

you can use event broadcasting features of laravel 5 in real-time.

every time user log in, need broadcast event. can follow tutorial: http://www.sitepoint.com/real-time-apps-laravel-5-1-event-broadcasting/

then on client side, need use javascript listen event.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -