'array', 'release_date' => 'date', 'type' => ChangelogType::class, ]; // --- Accessors & Mutators --- protected function formattedVersion(): Attribute { return Attribute::get(fn () => strtoupper($this->version)); } protected function formattedReleaseDate(): Attribute { return Attribute::get(fn () => $this->release_date?->translatedFormat('l, d M Y')); } protected function formattedCreatedAt(): Attribute { return Attribute::get(fn () => $this->created_at?->translatedFormat('l, d M Y H:i')); } protected function formattedUpdatedAt(): Attribute { return Attribute::get(fn () => $this->updated_at?->translatedFormat('l, d M Y H:i')); } protected function isRead(): Attribute { return Attribute::get(fn () => $this->users->isNotEmpty()); } // --- Relations --- public function users(): BelongsToMany { return $this->belongsToMany(User::class)->withPivot('read_at')->withTimestamps(); } }