Skip to content

[13.x] Fix resolveClassAttribute() cache key omitting the property - #60815

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
lazerg:fix/resolve-class-attribute-cache-key
Jul 16, 2026
Merged

[13.x] Fix resolveClassAttribute() cache key omitting the property#60815
taylorotwell merged 1 commit into
laravel:13.xfrom
lazerg:fix/resolve-class-attribute-cache-key

Conversation

@lazerg

@lazerg lazerg commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

resolveClassAttribute() leaves $property out of its cache key, so the object form and the property form of the same attribute share one cache slot. For #[Table] this collides initializeModelAttributes(), which caches the Table object, with isIgnoringTouch(), which caches the timestamps bool, so whichever runs first for a given model wins and #[Table(timestamps: false)] is silently ignored: the model is either still touched by its relations, or loses its table name and timestamps altogether, depending on call order. Adding $property to the key keeps the two forms apart.

Fixes #60803

@taylorotwell
taylorotwell merged commit 3480cdb into laravel:13.x Jul 16, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants