Prior to dispatching the job I run an eloquent query joining three tables and selecting data from each of those tables. I pass the result into the job constructor and assign it to $this->data but I believe that the SerializesModels trait is removing all joined data because:
Because of the SerializesModels trait that the job is using, Eloquent models will be gracefully serialized and unserialized when the job is processing. If your queued job accepts an Eloquent model in its constructor, only the identifier for the model will be serialized onto the queue. When the job is actually handled, the queue system will automatically re-retrieve the full model instance from the database.
So when I go to use $this->data in the handle method all the joined data is gone because the queue system re-retrieved the model instance.
How do I stop this from happening? I don't want to have to rerun a query that was already run.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2BseRfC
via IFTTT
Aucun commentaire:
Enregistrer un commentaire