12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace Database\Factories;
- use App\Models\Post;
- use App\Models\User;
- use Illuminate\Database\Eloquent\Factories\Factory;
- class PostFactory extends Factory
- {
- /**
- * The name of the factory's corresponding model.
- *
- * @var string
- */
- protected $model = Post::class;
- /**
- * Define the model's default state.
- *
- * @return array
- */
- public function definition()
- {
- return [
- 'title' => $this->faker->sentence,
- 'content' => $this->faker->paragraph,
- 'user_id' => User::factory()
- ];
- }
- }
|