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