How to trigger a Model Observer when import? #3545
Unanswered
alejandromora99
asked this question in
Q&A
Replies: 2 comments
-
Laravel doesn't call events/observers when batch insertion is used. You'll have to call the observer within the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Is there an example of this in the docs? I've removed WithBatchInserts,WithChunkReading,ShouldQueue and use WithUpserts. I thought since batching removed, it would trigger the observer since it's line by line? |
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 am importing multiple data from a "product" model, this model has an observer to add certain fields when they are created:
my problem is that it is not activated, I read in another question that this happened because the "insert" method was used, is there any way to activate the observer?
Beta Was this translation helpful? Give feedback.
All reactions