Invokable class as Eloquent event listener. How to type? #53572
Replies: 2 comments 2 replies
-
Why would callable be too wide ? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Yaaaay #53642 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use event listeners on some models to log property changes:
and that works, but it's not technically correct, because
HasEvents::updated()
expects\Illuminate\Events\QueuedClosure|\Closure|string|array
for callback, not an invokable class.Is there a better way to do that?, or could Laravel accept invokable classes? It could add
|callable
to the@param
, but that seems too wide. Maybe a new Laravel specific Eloquent event interface?Beta Was this translation helpful? Give feedback.
All reactions