ldc-crm/database/factories/CustomerInfoFactory.php
Jérémy Munsch 3619593485 Mise à plat CRM v2
- ajout une colonne new country pour enum
- fix des test v2
- fix du handler
- fix des middleware
- fix du timestamp checker
- fix des stats fix du api handler
- ajout du middleware json only
- remove crm-id du client en faveur du hashcode seulement
- fix du route service provider
- déplacement de la route arcradia en dehors du customer
2021-08-04 13:01:33 +02:00

45 lines
1.3 KiB
PHP

<?php
namespace Database\Factories;
use App\Enums\Country;
use App\Models\CustomerInfo;
use Illuminate\Database\Eloquent\Factories\Factory;
class CustomerInfoFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = CustomerInfo::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
$this->faker->addProvider(new \Faker\Provider\fr_FR\Address($this->faker));
$this->faker->addProvider(new \Faker\Provider\fr_FR\PhoneNumber($this->faker));
$countries = Country::toArray();
$country = $countries[\array_rand($countries)];
return [
'firstname' => $this->faker->firstName,
'lastname' => $this->faker->lastName,
'birth_date' => $this->faker->dateTimeBetween('-60 years', '-18 years'),
'address' => $this->faker->address,
'address2' => '',
'phone' => $this->faker->phoneNumber,
'country' => $country,
'newcountry' => $country,
'city' => $this->faker->city,
'postcode' => $this->faker->postcode,
'opt_in' => $this->faker->boolean,
'hashcode' => $this->faker->sha1
];
}
}