What's Changed
Larastan 3.15.0 requires PHPStan 2.3.5 or newer within the 2.x series. Update PHPStan alongside Larastan when upgrading. The PHP and Laravel requirements are unchanged.
Added
- Infer
Arr::mapWithKeys()callback parameter types and the mapped array's key and value types by @canvural in 0a72cb7. - Keep pivot model types in collections returned by
BelongsToManyandMorphToManyrelations with the opt-inpivotTypesInCollectionsparameter, disabled by default, by @canvural in #2634. Read more about it here. - Register Larastan's extensions using PHPStan DI attributes by @canvural in #2639.
Fixed
- Use custom pivot accessor names set with
as()inBelongsToManyresults by @canvural in #2634. - Preserve
staticand$thismodel types inSoftDeletesbuilder methods, includingonlyTrashed(),withTrashed(),withoutTrashed(),restoreOrCreate(), andcreateOrRestore(), by @odolbeau in #2617. - Use the model's
getForeignKey()when readingforeignIdFor()column names in migrations by @APX403 in #2638. - Read columns declared with
foreignUuidFor()andforeignUlidFor()in migrations by @APX403 in #2638. - Return the query result collection from Eloquent
insertOrIgnoreReturning()calls on Laravel 13.30.1 and newer by @canvural in ad65a79. - Handle reordered named arguments in rules and collectors, including view and translation usage detection, by @canvural in 3923362.
New Contributors
Full Changelog: v3.14.0...v3.15.0