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)