PackageTrack
Sign in Get early access

cyrildewit/eloquent-viewable

A minimalistic analytics package for Laravel with seamless view tracking for Eloquent models

v8.0.0 1.2M downloads/mo #4443 most downloaded on Packagist cyrildewit/eloquent-viewable

What this package is like to depend on

Last release 21 days ago

02 Aug 2026

Release timing varies

gaps range from 2 weeks to 1.2 years

Some releases are documented

notes for 28 of 48 stable releases

Nothing withdrawn

no release was ever pulled

9 years old

53 releases · first in 2017

3 releases in the last 12 months

see the full history below

Release timeline

51 releases · Jun 2017 to Aug 2026
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 53
  1. v8.0.0 02 Aug 2026
    Release notes

    See the upgrade guide for detailed migration instructions.

    Added

    • Added native type declarations across the public API

    Changed

    • Raised the minimum PHP version to ^8.5
    • The Views contract now declares the existing useVisitor() method (breaking only for classes that implement Contracts\Views directly)
    • Changed the cooldown() and remember() parameters on the Views contract to be typed DateTimeInterface|int|null
    • Changed the scopeWithinPeriod() method on the View contract to declare a void return type
    • Narrowed Period::getStartDateTime()/getEndDateTime() to return ?CarbonInterface
    • Marked the InvalidPeriod and ViewRecordException exceptions as final (breaking only for code that extends them)
    • The Viewable contract now uses @mixin \Illuminate\Database\Eloquent\Model instead of redeclaring the getKey() and getMorphClass() methods
    • The View contract now uses @mixin \Illuminate\Database\Eloquent\Model and declares the existing scopeCollection() method (breaking only for classes that implement Contracts\View directly)
    • Modernized the create_views_table migration stub (typed properties and return types)
    • Changed the visitor column in the create_views_table migration stub from text to string (VARCHAR(255)) so it can be indexed directly (only affects newly published migrations)
    • Changed the default config models.view.connection and cache.store to null, so they now defer to the application's default database connection and cache store instead of reading env('DB_CONNECTION') and the deprecated env('CACHE_DRIVER') (only affects newly published config)
    • Migrated the test suite from PHPUnit to Pest (development only; no impact on consumers)
    • Redesigned Period as a final, immutable (readonly) value object; relative periods are now built with the new Support\PeriodInterval and Support\PeriodAnchor enums, and date parsing defers to Carbon::make() (the factory methods, getStartDateTime()/getEndDateTime(), and the cache-key format are unchanged)

    Removed

    • Dropped support for Laravel 6 through 12 (illuminate/* now requires ^13.0)
    • Dropped support for Carbon 2 (nesbot/carbon now requires ^3.0)
    • Removed the getStartDateTimeString(), getEndDateTimeString(), getStartDateTimestamp() and getEndDateTimestamp() getters from Period
    • Removed the Period::PAST_* and Period::SUB_* constants and the sub(), subToday() and subNow() static helpers
    • Removed the Period::getSubType(), getSubValue(), hasFixedDateTimes(), setStartDateTime(), setEndDateTime(), setFixedDateTimes(), setSubType() and setSubValue() methods (Period is now immutable)
    Open source →
  2. v7.1.1 19 Jul 2026
    Release notes

    What's Changed

    Fixed

    • Fixed cooldown pruning when the session uses JSON serialization, where expires_at is restored as a string instead of a Carbon instance (#326)

    New Contributors

    Full Changelog: v7.1.0...v7.1.1

    Open source →
  3. v7.1.0 28 Mar 2026
    Release notes

    Changed

    • Add support for Laravel 13
    Open source →
  4. v7.0.6 02 Apr 2025
    Release notes

    What's Changed

    • Implicitly marking parameter $collection as nullable is deprecated, the explicit nullable type must be used instead. by @mstnorris in #314

    New Contributors

    Full Changelog: v7.0.5...v7.0.6

    Open source →
  5. v7.0.5 19 Mar 2025
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v7.0.4...v7.0.5

    Open source →
  6. v7.0.4 01 Mar 2025
    Release notes

    Changed

    New Contributors

    Full Changelog: v7.0.3...v7.0.4

    Open source →
  7. v7.0.3 15 May 2024
    Release notes

    Fixed

    Full Changelog: v7.0.2...v7.0.3

    Open source →
  8. v7.0.2 13 Mar 2024
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v7.0.1...v7.0.2

    Open source →
  9. v7.0.1 14 Apr 2023
    Release notes

    What's Changed

    New Contributors

    Full Changelog: v6.1.0...v7.0.1

    Open source →
  10. v6.1.0 28 Feb 2022
    Release notes

    Changed

    Open source →
  11. v6.0.2 02 Jan 2021

    Nothing published for this version

  12. v6.0.1 02 Jan 2021

    Nothing published for this version

  13. v6.0.0 30 Dec 2020

    Nothing published for this version

  14. v6.0.0-alpha.1 28 Dec 2020 pre-release

    Nothing published for this version

  15. v5.2.1 22 Sep 2020
    Release notes

    Changed

    • Add support for Laravel 8
    Open source →
  16. v5.2.0 28 Mar 2020

    Nothing published for this version

  17. v5.1.0 24 Mar 2020

    Nothing published for this version

  18. v5.0.0 16 Mar 2020

    Nothing published for this version

  19. v5.0.0-alpha.2 16 Mar 2020 pre-release

    Nothing published for this version

  20. v5.0.0-alpha.1 13 Mar 2020 pre-release

    Nothing published for this version

  21. v5.0.0-alpha.0 05 Mar 2020 pre-release

    Nothing published for this version

  22. v4.1.1 18 Oct 2019
    Release notes

    Fixed

    • Update required dependencies in composer.json to adhere to new Laravel 6 version scheme
    Open source →
  23. v4.1.0 05 Sep 2019
    Release notes

    Changed

    • Add support for Laravel 6
    Open source →
  24. v4.0.0 01 Jul 2019
    Release notes

    Added

    • Added SortDirection enum class that contains a DESCENDING and ASCENDING constant
    • Added OrderByViewsScope class that can order a query by views based on some options
    • Added collection($collection) query scope to View model
    • Added the ability to pass a collection to the orderByViews and orderByUniqueViews query scope
    • Added a new CacheKey class with a new improved approach to making keys for the cache
    • Added getStartDateTimestamp and getEndDateTimestamp methods to the Period class for internal use
    • Added string $collection = null argument to push, createNamespaceKey and createViewableKey methods in ViewSessionHistory

    Deprecated

    • Deprecated the overrideIpAddress method of the Views class. Please use the new useIpAddress(string $address) method instead.
    • Deprecated the overrideVisitor method of the Views class. Please use the new useVisitor(string $visitor) method instead.

    Changed

    • Replaced inner code of the orderByViews and orderByUniqueViews query scope with the new OrderByViewsScope class
    • Removed the string type declaration from the getTable method in the View model class #165

    Removed

    • Removed the Support\Key class with its references
    Open source →
  25. v3.2.0 03 Mar 2019
    Release notes

    Added

    • Add support for Laravel 5.8

    Changed

    • Use String and Array classes instead of the helper functions
    Open source →
  26. v3.1.0 29 Jan 2019
    Release notes

    Fixed

    • Fixed the ability to pass an integer to the delayInSession method without getting an error
    • Type cast the cached views count otherwise PHP's type hint will fail

    Added

    • Added the ability to override the visitor's unique ID that's used to distinguish unique views
    • Added the ability to specify a cache store that should be used by this package
    Open source →
  27. v3.0.2 25 Dec 2018
    Release notes

    Fixed

    • The method delayInSession isn't working properly
    Open source →
  28. v3.0.1 25 Dec 2018
    Release notes

    Fixed

    • Publishing package migrations results in error (#133)
    Open source →
  29. v3.0.0 17 Dec 2018
    Release notes

    Added

    • Added Views class with facade
    • Added IpAddressResolver contract with implementation
    • Added HeaderResolver contract with implementation
    • Added VisitorCookieRepository class
    • Added global helper views
    • Added collection column to views table schema
    • Added withinPeriod scope to View model
    • Added uniqueVisitor scope to View model

    Changed

    • Bumped minimum required PHP version to ^7.1
    • Require viewable models to implement the Viewable contract
    • Added global views() helper
    • Remove IP address as fallback for visitor cookie when it doesn't exists
    • Changed the isBot method name to isCrawler in CrawlerDetector contract and updated the CrawlerDetectAdapter
    • Changed the visibility of the $detector property from protected to private
    • Add support for 5.7.* of illuminate/config to composer.json
    • Moved config file from publishable/config to config/
    • Replace create_views_table stub with real migration file and load it inside the service provider
    • Allow strings to be passed to the constructor of the Period class
    • Extracted key generation logic from Period class to the Key class

    Removed

    • Removed the ViewTracker class
    • Removed the ViewableService class
    • Removed the ProcessView job
    • Removed the update_views_table migration file from resources/database/migrations
    • Removed illuminate/bus as dependency
    • Removed illuminate/queue as dependency
    • Removed illuminate/routing as dependency
    Open source →
  30. v2.5.0 03 Dec 2018
    Release notes

    Fixed

    • orderByViewsCount scope doesn't adhere to connection prefix
    Open source →
  31. v2.4.3 21 Oct 2018
    Release notes

    Fixed

    • Data too long for column visitor
    Open source →
  32. v2.4.2 21 Oct 2018
    Release notes

    Fixed

    • ProcessView job is always failing
    Open source →
  33. v2.4.1 12 Sep 2018
    Release notes

    Fixed

    • View is saved before ProcessViews job is ran
    Open source →
  34. v2.4.0 11 Sep 2018
    Release notes

    Changed

    • Add support for Laravel 5.7

    Deprecated

    • Deprecated the CyrildeWit\Support\IpAddress class
    • Deprecated the CyrildeWit\Viewtracker class
    • Deprecated the scopeOrderByViewsCount method in the Viewable trait
    • Deprecated the scopeOrderByUniqueViewsCount method in the Viewable trait
    Open source →
  35. v2.3.0 01 Aug 2018
    Release notes

    Added

    • Add orderByUniqueViewsCount scope to Viewable trait
    Open source →
  36. v2.2.0 23 Jul 2018
    Release notes

    Added

    • Add the ability to add a delay between views from the same session (#73)

    Changed

    • Caching is now turned off as default
    Open source →
  37. v2.1.0 28 May 2018
    Release notes

    This release accidentally contains no updates.

    Open source →
  38. v2.0.0 28 May 2018
    Release notes

    This major version contains some serious breaking changes! See the upgrade guide for more information!

    Added

    • Added visitor column to the create_views_table migration stub

    Changed

    • Changed the package name from cyrildewit/laravel-page-view-counter to cyrildewit/eloquent-viewable
    • Renamed the HasPageViewCounter trait to Viewable
    • Renamed the PageViewCounterServiceProvider class to EloquentViewableServiceProvider
    • Changed the namespace from CyrildeWit\PageViewCounter\xxx to 'CyrildeWit\EloquentViewable'
    • Added new options to the config file and changed the structure
    • Replaced the addPageView method with addView in the Viewable trait
    • Replaced all getPageViews<suffix> methods with getViews in the Viewable trait

    Removed

    • Removed the addPageViewThatExpiresAt method from the Viewable trait
    • The DateTransformer functionality has been removed
    Open source →
  39. v1.0.5 15 Mar 2018

    Nothing published for this version

  40. v1.0.4 20 Feb 2018

    Nothing published for this version

  41. v1.0.3 12 Jan 2018

    Nothing published for this version

  42. v1.0.2 01 Jan 2018

    Nothing published for this version

  43. v1.0.1 28 Dec 2017

    Nothing published for this version

  44. v1.0.0 24 Dec 2017

    Nothing published for this version

  45. v1.0.0-alpha 23 Dec 2017 pre-release

    Nothing published for this version

  46. v0.1.7 10 Oct 2017

    Nothing published for this version

  47. v0.1.6 19 Jul 2017

    Nothing published for this version

  48. v0.1.5 14 Jul 2017

    Nothing published for this version

  49. v0.1.4 17 Jun 2017

    Nothing published for this version

  50. v0.1.3 16 Jun 2017

    Nothing published for this version

  51. v0.1.2 15 Jun 2017

    Nothing published for this version

  52. v0.1.1 no date

    Nothing published for this version

  53. v0.1.0 no date

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive