Skip to content

mailable with relationship eagerload #44032

Answered by toto975
toto975 asked this question in Q&A
Discussion options

You must be logged in to vote

You're right, it has something to do with serializing models

It's about queue, relationship and (de)serialization.

In Laravel doc : https://laravel.com/docs/9.x/queues#handling-relationships

Any previous relationship constraints that were applied before the model was serialized
during the job queueing process will not be applied when the job is deserialized.
Therefore, if you wish to work with a subset of a given relationship,
you should re-constrain that relationship within your queued job.

For me, i've

relationship in controller --> mail queue --> serialization --> job handle --> deserialization --> mailable build

the constrain's relationship in controller must be re-constrain in the m…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by toto975
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants