*/ class BillingUnitFactory extends Factory { protected $model = BillingUnitModel::class; /** * @return array */ public function definition(): array { return [ 'customer_id' => CustomerModel::factory(), 'name' => fake()->company(), 'billing_address' => fake()->streetAddress()."\n".fake()->postcode().' '.fake()->city(), 'e_invoice_address' => null, 'e_invoice_operator' => null, 'reference' => null, ]; } public function eInvoice(string $address = '003712345678', string $operator = '003721291126'): static { return $this->state(fn (): array => [ 'e_invoice_address' => $address, 'e_invoice_operator' => $operator, ]); } }