fix: per package fixed
This commit is contained in:
@@ -36,8 +36,15 @@ public function handle(): void
|
||||
->withServiceAccount($firebaseFile);
|
||||
|
||||
$push = $factory->createMessaging();
|
||||
$fcmToken = $this->user->packageNames()->where('package_names.id', $this->packageName->id)->first()->pivot->fcm_token;
|
||||
$relation = $this->user->packageNames()
|
||||
->where('package_names.id', $this->packageName->id)
|
||||
->first();
|
||||
|
||||
if (!$relation || !$relation->pivot?->fcm_token) {
|
||||
return; // skip if no token
|
||||
}
|
||||
|
||||
$fcmToken = $relation->pivot->fcm_token;
|
||||
if (!$fcmToken) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user