<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\Commodity;
use Faker\Generator as Faker;

$factory->define(Commodity::class, function (Faker $faker) {
    $type = ["无","临时"];
    return [
        'name' => $faker->name,
        'sku' => md5(date('Ymd').\Illuminate\Support\Str::random(3)),
        'owner_id' => factory(\App\Owner::class),
        'length' => mt_rand(1,90) / 3,
        'width' => mt_rand(1,90) / 3,
        'height' => mt_rand(1,90) / 3,
        'volumn' => mt_rand(10,900) / 3,
        "type" => $type[array_rand($type)],
        "pack_spec" => mt_rand(1,100)
    ];
});
