<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\Company;
use Carbon\Carbon;
use Faker\Generator as Faker;
use Illuminate\Support\Str;

$factory->define(Company::class, function (Faker $faker) {
    return [
        "name" => $faker->company . " " . $faker->companySuffix,
        "slogan" => $faker->sentence,
        "email" => $faker->email,
        "logo_url" => $faker->imageUrl(),
        "cif" => $faker->countryCode . " " . $faker->numberBetween(10000000, 99999999) . $faker->randomLetter,
        "address" => $faker->address,
        "city" => $faker->city,
        "country" => $faker->country,
        "county" => Str::random(10),
        "phone" => $faker->phoneNumber,
        "zipcode" => $faker->postcode,
        "fact_name" => $faker->company,
        "fact_address_line1" => $faker->address,
        "fact_address_line2" => $faker->randomElement([null, $faker->address]),
        "fact_zipcode" => $faker->postcode,
        "fact_city" => $faker->city,
        "fact_county" => $faker->city,
        "fact_country_code" => $faker->countryCode,
        "fact_prefix" => $faker->randomElement([null, $faker->countryCode]),
        "fact_serie" => Carbon::now()->format("Y")
    ];
});
