onQueue((string) config('nntmux.api.audit_queue', 'api-audit')); } public function handle(): void { $lockKey = 'api_access_update:'.$this->userId; $interval = max(1, (int) config('nntmux.api.access_update_interval', 60)); try { if (! Cache::add($lockKey, true, $interval)) { return; } } catch (Throwable) { // Cache degradation must not prevent the metadata update. } $update = ['apiaccess' => $this->occurredAt]; if ($this->ip !== null) { $update['host'] = $this->ip; } DB::table('users')->where('id', $this->userId)->update($update); } }