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

[5.6] Only set ID on NotificationFake if there is no ID set #23470

Merged
merged 3 commits into from
Mar 9, 2018
Merged

[5.6] Only set ID on NotificationFake if there is no ID set #23470

merged 3 commits into from
Mar 9, 2018

Conversation

hotmeteor
Copy link
Contributor

@hotmeteor hotmeteor commented Mar 9, 2018

This PR makes the NotificationFake@sendNow method behave the same way as the sending functionality in the NotificationSender, in which the sender checks if the notification ID has already been set before setting it.

@hotmeteor hotmeteor changed the title Only set ID on NotificationFake if there is no ID set [5.6] Only set ID on NotificationFake if there is no ID set Mar 9, 2018
@ninjaparade
Copy link
Contributor

This might be the greatest idea since your ->doesntExist() on the Query builder that the frontend guy claimed as his own. 💥 💣

@taylorotwell taylorotwell merged commit 8a06746 into laravel:5.6 Mar 9, 2018
@@ -174,7 +174,9 @@ public function sendNow($notifiables, $notification)
}

foreach ($notifiables as $notifiable) {
$notification->id = Uuid::uuid4()->toString();
if (! $notification->id) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might sound a bit nitpicky, but wouldn't checking for null be preferable here to allow '0' to be used as an ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well a UUID would never be 0, so not sure that makes sense.

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.

4 participants