Skip to content

Observer for Pivot Model not firing #467

@Restingo

Description

@Restingo

Describe the bug
I've got two models, lets name them Company and Contact. I've also got a pivot model CompanyContact. For the pivot model I've created an observer that is called CompanyContactObserver.

Now if model caching is enabled via .env file the CompanyContactObserver doesn't fire.

Eloquent Query
Please provide the complete eloquent query that caused the bug, for example:

$company->contacts()->sync($contacts);

Stack Trace
None.

Environment

  • PHP: 8.1.28
  • OS: Ubuntu 22.04.4 LTS
  • Laravel: 10.44.0
  • Model Caching: 0.13.9

Additional context
If model caching is disabled the observer fires instantly.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions