*/ class PostFactory extends Factory { protected $model = Post::class; /** * Define the model's default state. * * @return array */ public function definition() { return [ 'journal_id' => Journal::factory(), 'title' => $this->faker->sentence(), 'published' => false, 'written_at' => $this->faker->dateTimeThisCentury(), ]; } }