Skip to content

v8.0.0

Latest

Choose a tag to compare

@cyrildewit cyrildewit released this 02 Aug 18:45
74b7cc6

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)