31 lines
976 B
PHP
31 lines
976 B
PHP
<?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 [
|
|
'feed_id' => \App\Models\Feed::factory(),
|
|
'url' => $this->faker->url(),
|
|
'title' => $this->faker->sentence(),
|
|
'description' => $this->faker->paragraph(),
|
|
'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']),
|
|
];
|
|
}
|
|
}
|