dimanche 20 novembre 2016

should i use middleware for updating view count or log for viewed history article?

I am still confused how to use middleware in right way, I have read the documentation about laravel middleware but all examples are about something related to Http such as authentication, adding proper headers or CSRF, it makes me doubt about what I am going to do.

my questions is:

Am I doing it right if I use middleware for updating view count or log for viewed history? or should I inject the the repository of each them instead and attach to specific function (viewArticle method for example)?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire