79122386

Date: 2024-10-24 14:26:33
Score: 0.5
Natty:
Report link

I had a similar problem and after many many hours of pulling my hair I finally found the culprit.

Turns out the query was using the global scope I had set on the model. Even though the (eloquent) query is updating/creating it still uses the global scopes you have set up.

So, adding withoutGlobalScope(YourGlobalScope::class) before the updateOrCreate() method fixed my issue. Hope this helps someone and saves you few hours of debugging!

Reasons:
  • Whitelisted phrase (-1): Hope this helps
  • No code block (0.5):
  • Low reputation (1):
Posted by: Stefan Rubelov