Invokable class as Eloquent event listener. How to type? #53572
Unanswered
rudiedirkx
asked this question in
Ideas
Replies: 1 comment 1 reply
-
Why would callable be too wide ? |
Beta Was this translation helpful? Give feedback.
1 reply
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