tag); $other = trim((string) $this->other_meaning); return [ 'id' => $this->when($request->route('kind') === 'grammar', fn () => (string) $this->guid), 'word' => (string) $this->word, 'tag' => $tag === '' ? null : $tag, 'meaning' => (string) $this->meaning, 'other_meaning' => $other === '' ? null : $other, ]; } }