cyrildewit/eloquent-viewable
Track page views on Eloquent models without third-party analytics. Record and count total or unique views, filter by date periods, order models by views, apply cooldowns, and optionally ignore crawlers. Stores each view as a DB record for flexible querying.
remember method in Views contract. The $lifetime variable has now a default value of null.remember method in Views class. The $lifetime variable has now a default value of null.bool return typehint to record method in Views contract.void return typehint to destroy method in Views contract.ViewRecordException will be thrown when trying to record a view for a viewable type.ViewRecorded event will be fired when a new view is recorded.Views typehint to global views() function.bool return typehint to isCrawler method in CrawlerDetector contract.composer.json to ^7.4|^8.0.View instance has been moved into its own method protected function createView(): View.$viewable argument of the forViewable method in Views contract cannot be nullable anymore.orderByViews and orderByUniqueViews query scope in Viewable contract and InteractsWithViews trait.withViewsCount query scope in InteractsWithViews trait.Period class typehint to $period argument of period method in Views contract.$name argument nullable in Views contract.ip method in Visitor contract to ?string.DateTime typehint to DateTimeInterface in InvalidPeriod exception.lifetime_in_minutes option from config file.count method of Views class to count all views, including the collections (#241).CyrildeWit\EloquentViewable\Contracts\Views to resolve Views instance from container.null) for viewable in views() helper.Views contract.Visitor contract.Visitor class which represents the current visitor.getViewableTypeSlug() to CacheKey::class.orderByViews query scope to Viewable trait.orderByUniqueViews query scope to Viewable trait.withViewsCount query scope to Viewable trait.CyrildeWit\EloquentViewable\Viewable trait has been renamed to CyrildeWit\EloquentViewable\InteractsWithViews.session.key to cooldown.key in configuration file.Views class constructor arguments. Added the Visitor as first argument and removed VisitorCookieRepository $visitorCookieRepository, rawlerDetector $crawlerDetector and IpAddressResolver $ipAddressResolver.$this->crawlerDetector in Views with new Visitor class implementation.requestHasDoNotTrackHeader in Views with new Visitor class implementation.increments to bigIncrements in views table migration.^6.0|^7.0.getConnectionName(), getDatabaseName(), getModelSlug() and getKeySlug in CacheKey::class.ViewSessionHistory class to CooldownMananger.CooldownManager class. The Illuminate\Contracts\Config\Repository has been added as first parameter and the cooldown key is now retrieved from this instance.Views class now implements the Views contract.Views class has been changed.Facades/Views to src/ and renamed it to ViewsFacade.views() helper now supports viewable types.nesbot/carbon ^1.22.overrideIpAddress method from the Views class.overrideVisitor method from the Views class.requestHasDoNotTrackHeader method from Views class.$viewableType argument from constructor of CacheKey::class.fromViewableType method from CacheKey::class.HeaderResolver contract and class.IpAddressResolver contract and class.uniqueVisitor() scope from View model.Enums\SortDirection class.OrderByViewsScope class.countByType method from the Views class.VisitorCookieRepository (logic is move to the Visitor class).SortDirection enum class that contains a DESCENDING and ASCENDING constantOrderByViewsScope class that can order a query by views based on some optionscollection($collection) query scope to View modelorderByViews and orderByUniqueViews query scopeCacheKey class with a new improved approach to making keys for the cachegetStartDateTimestamp and getEndDateTimestamp methods to the Period class for internal usestring $collection = null argument to push, createNamespaceKey and createViewableKey methods in ViewSessionHistoryoverrideIpAddress method of the Views class. Please use the new useIpAddress(string $address) method instead.overrideVisitor method of the Views class. Please use the new useVisitor(string $visitor) method instead.orderByViews and orderByUniqueViews query scope with the new OrderByViewsScope classstring type declaration from the getTable method in the View model class #165Support\Key class with its referencesdelayInSession method without getting an errordelayInSession isn't working properlyViews class with facadeIpAddressResolver contract with implementationHeaderResolver contract with implementationVisitorCookieRepository classviewscollection column to views table shemawithinPeriod scope to View modeluniqueVisitor scope to View modelViewable contractviews() helperisBot method name to isCrawler in CrawlerDetector contract and updated the CrawlerDetectAdapter$detector property from protected to private5.7.* of illuminate/config to composer.jsonpublishable/config to config/create_views_table stub with real migration file and load it inside the service providerPeriod classPeriod class to the Key classViewTracker classViewableService classProcessView jobupdate_views_table migration file from resources/database/migrationsilluminate/bus as dependencyilluminate/queue as dependencyilluminate/routing as dependencyorderByViewsCount scope doesn't adhere to connection prefixvisitorCyrildeWit\Support\IpAddress classCyrildeWit\Viewtracker classscopeOrderByViewsCount method in the Viewable traitscopeOrderByUniqueViewsCount method in the Viewable traitorderByUniqueViewsCount scope to Viewable traitThis release accidentally contains no updates.
This major version contains some serious breaking changes! See the upgrade guide for more information!
visitor collumn to the create_views_table migration stubcyrildewit/laravel-page-view-counter to cyrildewit/eloquent-viewableHasPageViewCounter trait to ViewablePageViewCounterServiceProvider class to EloquentViewableServiceProviderCyrildeWit\PageViewCounter\xxx to 'CyrildeWit\EloquentViewable'addPageView method with addView in the Viewable traitgetPageViews<suffix> methods with getViews in the Viewable traitaddPageViewThatExpiresAt method from the Viewable traitHow can I help you explore Laravel packages today?