Count post view
Created 3 years ago by wakandaWhat is your approach for add a counter 'hits' on view post module :
- Add custom field 'hits' to module post + Add middleware on route with post entry update ?
- Add custom field 'hits' to module post + Extend Eloquent model ?
- Add custom field 'hits' to module post + Form Handler update by route ?
- Others ?
Funny we do this in the forum module which I have just updated and am digging through older un-replied discussions 😛
We use a
view_count
column and update the count inline in the controller using a command.Be sure to wrap your query in
withoutEvents
like this: