Add DocumentTranslation model with renderMarkdown and search scope

Includes a minimal Document::translations() HasMany relation so that
DocumentFactory's afterCreating callback (which calls
$document->translations()->count()) works. The full Document model
refactor (accessors, fallback helpers, default-translation accessor)
lands in Task 4.
This commit is contained in:
Yutaka Kurosaki
2026-05-10 12:14:24 +09:00
parent 4a8622c385
commit b7a70f74e5
3 changed files with 136 additions and 0 deletions
+9
View File
@@ -281,6 +281,15 @@ public function recentByUsers(): HasManyThrough
);
}
/**
* Translations of this document, one per locale.
* (Other relation/accessor refactor lands in Task 4.)
*/
public function translations(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(DocumentTranslation::class);
}
/**
* ディレクトリパスを取得
*