Skip to content

Conversation

@mosabbirrakib
Copy link
Contributor

@mosabbirrakib mosabbirrakib commented Nov 25, 2025

This PR improves the typehints for the discarded 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, array))|null.

The callback receives:

  • The model instance (self)
  • An array of discarded attribute keys (array)

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

@taylorotwell taylorotwell merged commit cbaa9fa into laravel:12.x Nov 25, 2025
76 checks passed
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