30 lines
703 B
PHP
30 lines
703 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Document;
|
|
use App\Models\DocumentTranslation;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<DocumentTranslation>
|
|
*/
|
|
class DocumentTranslationFactory extends Factory
|
|
{
|
|
protected $model = DocumentTranslation::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
$title = fake()->sentence(3);
|
|
$content = fake()->paragraphs(3, true);
|
|
|
|
return [
|
|
'document_id' => Document::factory()->withoutTranslations(),
|
|
'locale' => 'en',
|
|
'title' => $title,
|
|
'content' => $content,
|
|
'rendered_html' => '<p>' . e($content) . '</p>',
|
|
];
|
|
}
|
|
}
|