Files
Caramel-CRM/database/factories/CustomerFactory.php
T
2025-10-20 08:57:51 +02:00

34 lines
1.2 KiB
PHP

<?php
namespace Database\Factories;
use App\Models\PaymentTerms;
use Illuminate\Database\Eloquent\Factories\Factory;
class CustomerFactory extends Factory
{
protected $model = \App\Models\Customer::class;
public function definition()
{
return [
'type' => $this->faker->randomElement(['private', 'business']),
'company_name' => $this->faker->company(),
'vat_id' => $this->faker->numerify('DE##########'),
'tax_id' => $this->faker->numerify('DE##########'),
'global_id' => $this->faker->numerify('############'),
'legal_registration_id' => $this->faker->numerify('##########'),
'email' => $this->faker->unique()->safeEmail(),
'phone' => $this->faker->phoneNumber(),
'billing_address' => [
'line_one' => $this->faker->streetAddress(),
'line_two' => '',
'city' => $this->faker->city(),
'postal_code' => $this->faker->postcode(),
'country_code' => 'DE',
],
'payment_terms_id' => PaymentTerms::where('name', 'daysAfterInvoice')->first()->id,
'logo' => null,
];
}
}