cyrildewit/eloquent-viewable
Track page views on Eloquent models without external analytics. Record views (with optional cooldown), count totals or unique views, filter by period, order models by popularity, and ignore bots/crawlers. Stores each view as a DB record for flexible reporting.
"Self-Hosted Analytics to Own Your Data and Boost Engagement"
"Lightweight, Extensible View Tracking for Eloquent Models"
View, Visitor) or add custom macros.views($post)->record().views($post)->period(Period::pastWeek())->unique()->count();
Post::orderByViews()->get(); // Descending
viewable_id and visitor columns for large datasets.remember() for frequent queries (e.g., dashboard widgets).How can I help you explore Laravel packages today?