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 2026Releases
latest 53-
v8.0.002 Aug 2026Release notes
Open source →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
Viewscontract now declares the existinguseVisitor()method (breaking only for classes that implementContracts\Viewsdirectly) - Changed the
cooldown()andremember()parameters on theViewscontract to be typedDateTimeInterface|int|null - Changed the
scopeWithinPeriod()method on theViewcontract to declare avoidreturn type - Narrowed
Period::getStartDateTime()/getEndDateTime()to return?CarbonInterface - Marked the
InvalidPeriodandViewRecordExceptionexceptions asfinal(breaking only for code that extends them) - The
Viewablecontract now uses@mixin \Illuminate\Database\Eloquent\Modelinstead of redeclaring thegetKey()andgetMorphClass()methods - The
Viewcontract now uses@mixin \Illuminate\Database\Eloquent\Modeland declares the existingscopeCollection()method (breaking only for classes that implementContracts\Viewdirectly) - Modernized the
create_views_tablemigration stub (typed properties and return types) - Changed the
visitorcolumn in thecreate_views_tablemigration stub fromtexttostring(VARCHAR(255)) so it can be indexed directly (only affects newly published migrations) - Changed the default config
models.view.connectionandcache.storetonull, so they now defer to the application's default database connection and cache store instead of readingenv('DB_CONNECTION')and the deprecatedenv('CACHE_DRIVER')(only affects newly published config) - Migrated the test suite from PHPUnit to Pest (development only; no impact on consumers)
- Redesigned
Periodas afinal, immutable (readonly) value object; relative periods are now built with the newSupport\PeriodIntervalandSupport\PeriodAnchorenums, and date parsing defers toCarbon::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/carbonnow requires^3.0) - Removed the
getStartDateTimeString(),getEndDateTimeString(),getStartDateTimestamp()andgetEndDateTimestamp()getters fromPeriod - Removed the
Period::PAST_*andPeriod::SUB_*constants and thesub(),subToday()andsubNow()static helpers - Removed the
Period::getSubType(),getSubValue(),hasFixedDateTimes(),setStartDateTime(),setEndDateTime(),setFixedDateTimes(),setSubType()andsetSubValue()methods (Periodis now immutable)
-
v7.1.119 Jul 2026Release notes
Open source →What's Changed
Fixed
- Fixed cooldown pruning when the session uses JSON serialization, where
expires_atis restored as a string instead of a Carbon instance (#326)
New Contributors
Full Changelog: v7.1.0...v7.1.1
- Fixed cooldown pruning when the session uses JSON serialization, where
-
v7.1.028 Mar 2026 -
v7.0.602 Apr 2025Release notes
Open source →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
- @mstnorris made their first contribution in #314
Full Changelog: v7.0.5...v7.0.6
-
v7.0.519 Mar 2025Release notes
Open source →What's Changed
- refactor: fix deprecation warning. by @mikebronner in #312
- chore(ci-deps): bump codecov/codecov-action from 1 to 5 by @dependabot in #310
New Contributors
- @mikebronner made their first contribution in #312
Full Changelog: v7.0.4...v7.0.5
-
v7.0.401 Mar 2025 -
v7.0.315 May 2024Release notes
Open source → -
v7.0.213 Mar 2024Release notes
Open source →What's Changed
- Laravel 11 support by @janyksteenbeek in #295
- Laravel 11 support - Allow phpunit ^10.0 as dev dependency by @cyrildewit in #297
New Contributors
- @janyksteenbeek made their first contribution in #295
Full Changelog: v7.0.1...v7.0.2
-
v7.0.114 Apr 2023Release notes
Open source →What's Changed
- Fix CONTRIBUTING.md fix a typo in the phpunit run example by @kudashevs in #269
- Update run-tests.yml by @kudashevs in #270
- fixed deprecated variable in string by @Mahmoud217TR in #280
- [upgrade] Add Laravel 10 support by @cstriuli in #282
- Fix/failing tests Laravel 10 by @blackjak231 in #287
New Contributors
- @kudashevs made their first contribution in #269
- @Mahmoud217TR made their first contribution in #280
- @cstriuli made their first contribution in #282
- @blackjak231 made their first contribution in #287
Full Changelog: v6.1.0...v7.0.1
-
v6.1.028 Feb 2022 -
v6.0.202 Jan 2021Nothing published for this version
-
v6.0.102 Jan 2021Nothing published for this version
-
v6.0.030 Dec 2020Nothing published for this version
-
v6.0.0-alpha.128 Dec 2020 pre-releaseNothing published for this version
-
v5.2.122 Sep 2020 -
v5.2.028 Mar 2020Nothing published for this version
-
v5.1.024 Mar 2020Nothing published for this version
-
v5.0.016 Mar 2020Nothing published for this version
-
v5.0.0-alpha.216 Mar 2020 pre-releaseNothing published for this version
-
v5.0.0-alpha.113 Mar 2020 pre-releaseNothing published for this version
-
v5.0.0-alpha.005 Mar 2020 pre-releaseNothing published for this version
-
v4.1.118 Oct 2019Release notes
Open source →Fixed
- Update required dependencies in composer.json to adhere to new Laravel 6 version scheme
-
v4.1.005 Sep 2019 -
v4.0.001 Jul 2019Release notes
Open source →Added
- Added
SortDirectionenum class that contains aDESCENDINGandASCENDINGconstant - Added
OrderByViewsScopeclass that can order a query by views based on some options - Added
collection($collection)query scope toViewmodel - Added the ability to pass a collection to the
orderByViewsandorderByUniqueViewsquery scope - Added a new
CacheKeyclass with a new improved approach to making keys for the cache - Added
getStartDateTimestampandgetEndDateTimestampmethods to thePeriodclass for internal use - Added
string $collection = nullargument topush,createNamespaceKeyandcreateViewableKeymethods inViewSessionHistory
Deprecated
- Deprecated the
overrideIpAddressmethod of theViewsclass. Please use the newuseIpAddress(string $address)method instead. - Deprecated the
overrideVisitormethod of theViewsclass. Please use the newuseVisitor(string $visitor)method instead.
Changed
- Replaced inner code of the
orderByViewsandorderByUniqueViewsquery scope with the newOrderByViewsScopeclass - Removed the
stringtype declaration from thegetTablemethod in theViewmodel class #165
Removed
- Removed the
Support\Keyclass with its references
- Added
-
v3.2.003 Mar 2019Release notes
Open source →Added
- Add support for Laravel 5.8
Changed
- Use String and Array classes instead of the helper functions
-
v3.1.029 Jan 2019Release notes
Open source →Fixed
- Fixed the ability to pass an integer to the
delayInSessionmethod 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
- Fixed the ability to pass an integer to the
-
v3.0.225 Dec 2018 -
v3.0.125 Dec 2018 -
v3.0.017 Dec 2018Release notes
Open source →Added
- Added
Viewsclass with facade - Added
IpAddressResolvercontract with implementation - Added
HeaderResolvercontract with implementation - Added
VisitorCookieRepositoryclass - Added global helper
views - Added
collectioncolumn to views table schema - Added
withinPeriodscope toViewmodel - Added
uniqueVisitorscope toViewmodel
Changed
- Bumped minimum required PHP version to ^7.1
- Require viewable models to implement the
Viewablecontract - Added global
views()helper - Remove IP address as fallback for visitor cookie when it doesn't exists
- Changed the
isBotmethod name toisCrawlerinCrawlerDetectorcontract and updated theCrawlerDetectAdapter - Changed the visibility of the
$detectorproperty fromprotectedtoprivate - Add support for
5.7.*ofilluminate/configtocomposer.json - Moved config file from
publishable/configtoconfig/ - Replace
create_views_tablestub with real migration file and load it inside the service provider - Allow strings to be passed to the constructor of the
Periodclass - Extracted key generation logic from
Periodclass to theKeyclass
Removed
- Removed the
ViewTrackerclass - Removed the
ViewableServiceclass - Removed the
ProcessViewjob - Removed the
update_views_tablemigration file fromresources/database/migrations - Removed
illuminate/busas dependency - Removed
illuminate/queueas dependency - Removed
illuminate/routingas dependency
- Added
-
v2.5.003 Dec 2018 -
v2.4.321 Oct 2018 -
v2.4.221 Oct 2018 -
v2.4.112 Sep 2018 -
v2.4.011 Sep 2018Release notes
Open source →Changed
- Add support for Laravel 5.7
Deprecated
- Deprecated the
CyrildeWit\Support\IpAddressclass - Deprecated the
CyrildeWit\Viewtrackerclass - Deprecated the
scopeOrderByViewsCountmethod in theViewabletrait - Deprecated the
scopeOrderByUniqueViewsCountmethod in theViewabletrait
-
v2.3.001 Aug 2018 -
v2.2.023 Jul 2018Release notes
Open source →Added
- Add the ability to add a delay between views from the same session (#73)
Changed
- Caching is now turned off as default
-
v2.1.028 May 2018 -
v2.0.028 May 2018Release notes
Open source →This major version contains some serious breaking changes! See the upgrade guide for more information!
Added
- Added
visitorcolumn to thecreate_views_tablemigration stub
Changed
- Changed the package name from
cyrildewit/laravel-page-view-countertocyrildewit/eloquent-viewable - Renamed the
HasPageViewCountertrait toViewable - Renamed the
PageViewCounterServiceProviderclass toEloquentViewableServiceProvider - Changed the namespace from
CyrildeWit\PageViewCounter\xxxto 'CyrildeWit\EloquentViewable' - Added new options to the config file and changed the structure
- Replaced the
addPageViewmethod withaddViewin theViewabletrait - Replaced all
getPageViews<suffix>methods withgetViewsin theViewabletrait
Removed
- Removed the
addPageViewThatExpiresAtmethod from theViewabletrait - The DateTransformer functionality has been removed
- Added
-
v1.0.515 Mar 2018Nothing published for this version
-
v1.0.420 Feb 2018Nothing published for this version
-
v1.0.312 Jan 2018Nothing published for this version
-
v1.0.201 Jan 2018Nothing published for this version
-
v1.0.128 Dec 2017Nothing published for this version
-
v1.0.024 Dec 2017Nothing published for this version
-
v1.0.0-alpha23 Dec 2017 pre-releaseNothing published for this version
-
v0.1.710 Oct 2017Nothing published for this version
-
v0.1.619 Jul 2017Nothing published for this version
-
v0.1.514 Jul 2017Nothing published for this version
-
v0.1.417 Jun 2017Nothing published for this version
-
v0.1.316 Jun 2017Nothing published for this version
-
v0.1.215 Jun 2017Nothing published for this version
-
v0.1.1no dateNothing published for this version
-
v0.1.0no dateNothing published for this version