'boolean', 'read_at' => 'datetime', ]; } // 2. Scope (grouped by column, then alphabetical) // Column Group: is_read #[Scope] protected function read(Builder $query): void { $query->where('is_read', true); } #[Scope] protected function unread(Builder $query): void { $query->where('is_read', false); } // 3. Other Methods public function markAsRead(): void { if (! $this->is_read) { $this->update(['is_read' => true, 'read_at' => now()]); } } // 4. Relation public function user(): BelongsTo { return $this->belongsTo(User::class); } }