*/ class InvoicePositionFactory extends Factory { protected $model = InvoicePosition::class; /** * Define the model's default state. * * @return array */ public function definition() { return [ 'description' => $this->faker->words(4, true), 'member_id' => Member::factory()->defaults()->create()->id, ]; } public function price(int $price): self { return $this->state(['price' => $price]); } }