|null $data * @property Carbon|null $read_at * @property Carbon $created_at */ class InAppNotification extends Model { protected $table = 'notifications'; // Immutable except read_at: created_at only, written explicitly by // Notifier — same convention as ActivityLog. public $timestamps = false; protected $guarded = []; protected function casts(): array { return [ 'data' => 'json', 'read_at' => 'datetime', 'created_at' => 'datetime', ]; } /** * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * @return MorphTo */ public function subject(): MorphTo { return $this->morphTo(); } }