You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
891 B
PHTML

1 year ago
<?php
namespace Database\Factories;
9 months ago
use App\Models\Address;
use App\Models\Customer;
1 year ago
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Model>
*/
class CustomerFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
9 months ago
$state = rand(1,31);
$k = array_keys(Address::$cities[$state]);
shuffle($k);
1 year ago
return [
//
9 months ago
'name' => $this->faker->name,
'address' => $this->faker->address,
'mobile' => '0912'.rand(1111111,9999999),
'email' => $this->faker->unique()->email,
'state' => $state,
'city' => $k[0],
'password' => bcrypt('password'),
'credit' => 0,
1 year ago
];
}
}