'boolean', 'first_seen_at' => 'datetime', 'last_seen_at' => 'datetime', ]; protected $hidden = [ 'id', 'user_id', 'push_token', ]; // ── Relationships ── public function user() { return $this->belongsTo(User::class); } // ── Scopes ── public function scopeTrusted($query) { return $query->where('is_trusted', true); } public function scopeForFingerprint($query, string $fingerprint) { return $query->where('device_fingerprint', $fingerprint); } // ── Helpers ── public function markSeen(): bool { return $this->update(['last_seen_at' => now()]); } public function trust(): bool { return $this->update(['is_trusted' => true]); } public function revoke(): bool { return $this->update(['is_trusted' => false]); } }