*/ class CustomerFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition() { $state = rand(1,31); $k = array_keys(Address::$cities[$state]); shuffle($k); return [ // '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, ]; } }