php - Laravel - How count daily accesses in app -
i need show chart show application accesses , think in create table save user , date access.
but insert in table need know laravel did login authentication. don't know file , function.
if has better solution appreciate that.
thank you
you can create global middleware in order log accesses. https://laravel.com/docs/5.5/middleware#global-middleware
then if don't want have lot of logs same user, can use cache specific expire time. example: log user access once every 24hrs.
another approach use login events log user accesses. https://laravel.com/docs/5.2/authentication#events
illuminate\auth\events\login (this way every logins count access)
there event added in laravel version 5.3
illuminate\auth\events\authenticated (i assume event fired every time user authenticated)
you can create listener check of these events better purpose.
Comments
Post a Comment