fix: send due parameters
This commit is contained in:
@@ -70,22 +70,14 @@ public function handle(): int
|
||||
}
|
||||
// Otherwise, send to all users that have this package
|
||||
else {
|
||||
$users = $packageName->users()->whereNotNull('package_name_user.fcm_token')->get();
|
||||
|
||||
foreach ($users as $user) {
|
||||
$fcmToken = $user->packageNames()->where('package_names.id', $packageName->id)->first()->pivot->fcm_token;
|
||||
|
||||
if (!$fcmToken) continue;
|
||||
|
||||
SendPushToPackageJob::dispatch(
|
||||
user: $user,
|
||||
title: $reminder->title,
|
||||
packageName: $packageName,
|
||||
description: $reminder->description ?? '',
|
||||
data: $reminder->data ?? []
|
||||
);
|
||||
}
|
||||
}
|
||||
// Just dispatch the job once for all users with this package
|
||||
SendPushToPackageJob::dispatch(
|
||||
$packageName,
|
||||
$reminder->title,
|
||||
$reminder->description ?? '',
|
||||
$reminder->data ?? []
|
||||
);
|
||||
}
|
||||
|
||||
$reminder->last_repeat = now();
|
||||
$reminder->save();
|
||||
|
||||
Reference in New Issue
Block a user