Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Fix serialization of models when sending notifications #32051

Merged
merged 3 commits into from
Mar 20, 2020
Merged

[7.x] Fix serialization of models when sending notifications #32051

merged 3 commits into from
Mar 20, 2020

Conversation

axlon
Copy link
Contributor

@axlon axlon commented Mar 20, 2020

Fixes #32039, caused by a previous pull request of mine (#31675).

Wrapping models in a normal collection causes them to no longer be properly serialized as the normal collection does not implement Illuminate\Contracts\Queue\QueueableCollection. So Models are now wrapped in an eloquent collection instead.

I also added an extra check to prevent the job from wrapping the notifiable(s) if it receives a collection (rather than a object or an array), this makes sure any custom queueable collections aren't re-wrapped (breaking their serialization logic)

@axlon axlon requested a review from GrahamCampbell March 20, 2020 16:33
@taylorotwell taylorotwell merged commit 435f16e into laravel:7.x Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[7.x] Notifiables no longer serialized when being queued
3 participants