subscription = $subscription->withoutRelations(); $this->contact = $contact; } /** * Update the Last Consulted At field for the given contact. * * @return void */ public function handle(): void { if (! $this->batching()) { return; } Log::info(__CLASS__.' '.$this->contact->uri); $headers = []; switch ($this->contact->mode) { case ContactPushDto::MODE_MATCH_ETAG: $headers['If-Match'] = $this->contact->etag; break; case ContactPushDto::MODE_MATCH_ANY: $headers['If-Match'] = '*'; break; } $response = $this->subscription->getClient() ->request('PUT', $this->contact->uri, $this->contact->card, $headers); $etag = $response->header('Etag'); $contact = Contact::where('account_id', $this->subscription->account_id) ->findOrFail($this->contact->contactId); $contact->distant_etag = empty($etag) ? null : $etag; $contact->save(); } }