eloquent-viewable icon indicating copy to clipboard operation
eloquent-viewable copied to clipboard

how to get total number of views of all posts

Open PaulChase opened this issue 2 years ago • 1 comments

  • Eloquent Viewable: 6.0
  • Laravel Version: 8.40
  • PHP Version: 7.4

Question:

How do I access the total number of posts and other metrics for all the posts in my posts table?

I want to be able to access the metrics of all the posts not that I have to find a post by the ID then pass it as a parameter to the views method. Is they a way I can get that done?

PaulChase avatar Jan 08 '22 22:01 PaulChase

Hey @PaulChase,

This package is basically providing an Eloquent model (View) and predefined relationships/order by queries. Anything else that's not supported out the blue, can be implemented by using the provided functionality from Eloquent.

If you think your solution might be useful for others, feel free to send create a pull request to add it to the core.

cyrildewit avatar Mar 06 '22 19:03 cyrildewit