I am using Laravel 5.2. How can I increment a hits field in articles table when a specific an article is visited by the user?
This is the code I came up with:
Article::where('id', 2)->increment('hits');
Where would be the best place to insert this code to?