<?php

// Composer: "fzaninotto/faker": "v1.3.0"
use Faker\Factory as Faker;

class CustomerTableSeeder extends Seeder {

	public function run()
	{
		$faker = Faker::create();
		DB::table('Customers')->delete();
		$branch = Branch::first();
		$user = User::first();
		foreach(range(1, 500) as $index)
		{
			Customer::create([
			'last_name' => $faker->lastName,
			'first_name' => $faker->firstName,
			'sex' => $faker->randomElement(array('Male','Female')),
			'tel' => $faker->phoneNumber,
			'email' => $faker->email,
			'age' => $faker->randomNumber(2),
			'address' => $faker->address,
			'photo' => $faker->imageUrl,
			'branch_id' => $branch->id,
			'user_id'   => $user->id
			]);
		}
	}
}