M
M
mrFlyer2019-11-14 21:27:45
Laravel
mrFlyer, 2019-11-14 21:27:45

How to pass an additional parameter to the Observer?

Greetings!
Let's say there is a model with which several users work. When changing some attributes, you need to send a notification that Vasya has changed the fields such and such.
Of course, you can simply pull a separate event and transfer there the changed attributes and data of the user who changes the data. Is there such a mechanism through the Observer?
The first thing that comes to mind is to add temporary value into a mutable object and catch it in the observer without saving it to the database. But I'm not sure if this is the correct solution.
Please advise how best to do it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin B., 2019-11-14
@mrFlyer

Laravel dirty model + Auth::user()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question