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:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
* ディレクトリパスを取得
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user