This repository has been archived on 2025-12-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Caramel-CRM-Backup/database/factories/CustomerFactory.php
T

37 lines
1.3 KiB
PHP

<?php
namespace Database\Factories;
use App\Models\PaymentTerms;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Http\Controllers\CustomerController;
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(),
'customer_nr' => CustomerController::generateCustomerNumber(),
'vat_id' => $this->faker->numerify('DE##########'),
'tax_id' => $this->faker->numerify('DE##########'),
'global_id' => $this->faker->numerify('############'),
'legal_registration_id' => $this->faker->numerify('##########'),
'url' => $this->faker->url(),
'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,
];
}
}