What's Changed
This release focuses on Eloquent Builder type coverage — new aggregate accessor resolution (withCount/withExists/withSum/withMin/withMax/withAvg), SoftDeletes on Builder instances, where{Column} dynamic methods on builder and relations, and several stub fixes that restore correct pivot types.
Features
- Add opt-out dynamic
where{Column}method resolution on relation chains (#714) - Resolve
withCount/withExists/withSum/withMin/withMax/withAvgaggregate accessor properties on Eloquent models (#715) - Support
SoftDeletesmethods resolving on baseBuilderinstances (#727) - Update
BelongsToMany/MorphToManystubs to declare 4 template params, restoring pivot types in return values (#716) - Infer
Carbonfornow()andtoday()helpers (#725) - Validate
dispatch()arguments against job/event constructor signature (#726) - Narrow
Auth::guard()return type to the concrete guard class (#711) - Narrow
Collection::whereNotNull()to removenullfromTValue(#713) - Narrow
env()return type based on the default value argument (#712)
Fixes
- Fix
collect()with no args to returnCollection<never, never>(#722) - Add
@property-readstubs for higher-order collection proxies (#720) - Add conditional return type stub for
Str::replace()(#719) - Stub
Conditionable::when()/unless()andTappable::tap()to fixmixedreturn on fluent chains (#710) - Fix
Collection::empty()andCollection::sum()return types (#683) - Add
@psalm-this-outto paginatorsetCollection()(#688) - 🛡️ Add
@psalm-taint-escape sqlto parameterizedBuildermethods (#691) - 🛡️ Remove false-positive
TaintedHtmlsinks from Blade view data (#690)
Full Changelog: v4.6.2...v4.7.0