32 lines
981 B
PHP
32 lines
981 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Customer;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class CustomerFactory extends Factory
|
|
{
|
|
protected $model = Customer::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
$street = $this->faker->streetAddress();
|
|
$ward = 'Phường ' . $this->faker->numberBetween(1, 15);
|
|
$district = 'Quận ' . $this->faker->numberBetween(1, 12);
|
|
$city = $this->faker->city();
|
|
$fullAddress = "{$street}, {$ward}, {$district}, {$city}";
|
|
|
|
return [
|
|
'full_name' => $this->faker->name(),
|
|
'cmnd_cccd' => $this->faker->unique()->numerify('0##########'),
|
|
'phone' => $this->faker->phoneNumber(),
|
|
'email' => $this->faker->unique()->safeEmail(),
|
|
'type' => 'INDIVIDUAL',
|
|
'permanent_address' => $fullAddress,
|
|
'contact_address' => $fullAddress,
|
|
'dob' => $this->faker->date(),
|
|
];
|
|
}
|
|
}
|