Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Eloquent Viewable Laravel Package

cyrildewit/eloquent-viewable

Track and query page views on Eloquent models without external analytics. Record views with optional cooldown, count totals/unique views, filter by date periods, order models by views, and ignore crawlers. Stores each view as a DB record.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Analytics-Driven Features: Enables tracking of content engagement (e.g., blog posts, product pages) without third-party dependencies, supporting data-driven product decisions like prioritizing high-traffic content or A/B testing visibility.
  • Monetization & Personalization: Powers "popular content" recommendations, sponsored placements, or dynamic pricing based on view counts (e.g., "Top 10 Most Viewed Products").
  • Build vs. Buy: Avoids vendor lock-in with Google Analytics or Mixpanel while maintaining granularity (e.g., time-based, unique, or collection-specific metrics).
  • Roadmap for Growth: Scales with user base without requiring backend architecture overhauls (e.g., caching layers, database optimizations).
  • Compliance & Privacy: Aligns with GDPR/CCPA by storing view data internally (vs. external analytics) and offering IP/crawler filtering.

When to Consider This Package

  • Avoid if:

    • You need real-time event tracking beyond views (e.g., clicks, scroll depth) → Use a dedicated analytics tool (e.g., Matomo, Plausible).
    • Your app has <10K monthly views → Overhead of database storage may not justify the benefit.
    • You require user segmentation (e.g., demographics, behavior flows) → Third-party tools offer richer profiles.
    • Your team lacks PHP/Laravel expertise → Maintenance of custom view logic may become a burden.
  • Consider if:

    • You’re building a content-heavy platform (blogs, news, e-commerce) where view counts drive UX (e.g., trending sections).
    • You prioritize data ownership and want to avoid third-party tracking scripts.
    • Your stack is Laravel-centric, and you need seamless integration with Eloquent models.
    • You can tolerate database growth (or plan for optimizations like caching/archiving).

How to Pitch It (Stakeholders)

For Executives: "This package lets us track how users engage with our content—like blog posts or product pages—directly in our database, without relying on external tools. It’s lightweight, privacy-friendly, and gives us precise metrics (e.g., ‘views in the last 7 days’) to optimize what we highlight or promote. For example, we could automatically surface the top 5 most-viewed articles on our homepage, or adjust ad placements based on traffic. It’s a cost-effective way to build analytics into our product natively."

For Engineers: *"Eloquent Viewable is a battle-tested Laravel package that adds view tracking to Eloquent models with minimal setup. Key benefits:

  • Zero dependencies beyond Laravel (no API calls or external scripts).
  • Flexible queries: Filter by time, uniqueness, or custom collections (e.g., ‘views from paid campaigns’).
  • Performance optimizations: Built-in caching and database indexing to handle scale.
  • Extensible: Swap out the View model, add custom visitor data, or ignore bots/crawlers. Use case: Drop this into your PostController to track views, then use the orderByViews() scope to rank content dynamically. Pair with Laravel’s scheduler to cache metrics for high-traffic pages."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/framework-extra-bundle
codraw/messenger
codraw/security
codraw/mailer
codraw/contracts
codraw/profiling
codraw/dependency-injection
codraw/tester
codraw/core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony