<?php

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

class OutletsTableSeeder extends Seeder {

	public function run()
	{
		$faker = Faker::create();
    DB::table('Outlets')->delete();
		foreach(range(1, 300) as $index)
		{
      $product = Product::orderBy(DB::raw('RAND()'))->first();
      $user = User::first();
      $stock = Stock::orderBy(DB::raw('RAND()'))->first();

			Outlet::create([
        "product_id"  => $product->id,
        "user_id"     => $user->id,
        "amount"      => $faker->numberBetween(10,50),
        "sku"         => $product->sku,
        "price"       => $product->price,
        "stock_id"   => $stock->id
			]);

		}
	}

}