'boolean', 'taken_at' => 'integer', 'expiring_at' => 'integer', 'muted' => 'boolean', 'scraped_at' => 'datetime', 'viewed_at' => 'datetime', ]; public function scopeActive($query) { return $query->where('expiring_at', '>', now()->timestamp); } public function getIsUnreadAttribute(): bool { return $this->viewed_at === null; } }