Presuming you have the total amount of posts in a posts array you can use the length twig filter
Displaying {{ posts|length }} posts
What do you even mean by a view?
Is it how many times a request is made to a post?
If so how are you tracking views of a post? Do you have a views field on the post that is incremented each time a post is "viewed"? Do you have a post views table that is being inserted into whenever a post is "viewed"? Are you using an external tracking service like Piwik or Google Analytics?
Or is that what you are asking "What is a way to track views of a post?"
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community