fedi-feed-router/database/factories/ArticleFactory.php

32 lines
976 B
PHP
Raw Normal View History

2025-06-29 09:37:49 +02:00
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Article>
*/
class ArticleFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
2025-07-06 16:51:09 +02:00
'feed_id' => \App\Models\Feed::factory(),
'url' => $this->faker->url(),
'title' => $this->faker->sentence(),
'description' => $this->faker->paragraph(),
2025-08-10 21:18:20 +02:00
'content' => $this->faker->paragraphs(3, true),
'image_url' => $this->faker->optional()->imageUrl(),
'published_at' => $this->faker->optional()->dateTimeBetween('-1 month', 'now'),
'author' => $this->faker->optional()->name(),
'approval_status' => $this->faker->randomElement(['pending', 'approved', 'rejected']),
2025-06-29 09:37:49 +02:00
];
}
}