$payload */ public function __construct(public readonly int $userId, public readonly array $payload) {} public function handle(WebPush $push, ExpoPush $expo): void { $devices = AppDevice::query()->where('user_id', $this->userId)->get(); if ($devices->isNotEmpty()) { try { $expo->send($devices, $this->payload); } catch (Throwable $e) { report($e); } } foreach (PushSubscription::query()->where('user_id', $this->userId)->get() as $subscription) { try { $push->send($subscription, $this->payload) ? $subscription->forceFill(['last_used_at' => now()])->save() : $subscription->delete(); } catch (Throwable $e) { report($e); } } } }