Skip to content

[12.x] Improve missing attribute violation callable typehints#57910

Merged
taylorotwell merged 1 commit into
laravel:12.xfrom
mosabbirrakib:improve-missing-attribute-violation-typehints
Nov 25, 2025
Merged

[12.x] Improve missing attribute violation callable typehints#57910
taylorotwell merged 1 commit into
laravel:12.xfrom
mosabbirrakib:improve-missing-attribute-violation-typehints

Conversation

@mosabbirrakib

@mosabbirrakib mosabbirrakib commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

This PR improves the typehints for the missing attribute violation callback by specifying the exact callable signature.

Improved the lazy loading violation callback typehints, this change makes the callable signature more explicit by changing from callable|null to (callable(self, string))|null.

The callback receives:

  • The model instance (self)
  • The missing attribute key (string)

This provides better IDE support and makes the expected callback signature clearer to developers.

@taylorotwell taylorotwell merged commit 71d2dda into laravel:12.x Nov 25, 2025
76 checks passed
akyrey pushed a commit to akyrey/framework that referenced this pull request Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants