<?php

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

class SupplierTableSeeder extends Seeder {

	public function run()
	{
		$faker = Faker::create();
		DB::table('Suppliers')->delete();
		$position = Position::orderBy(DB::raw('RAND()'))->first();
		foreach(range(1, 5) as $index)
		{
			Supplier::create([
				'company_name'  => $faker->company,
				'contact_name'  => $faker->name,
				'contact_tel'   => $faker->phoneNumber,
				'address'       => $faker->address,
				'tel'           => $faker->phoneNumber,
				'company_email' => $faker->email,
				'contact_email' => $faker->email,
				'logo'          => $faker->imageUrl,
				'position_id'   => $position->id
			]);
		}
	}

}