<?php

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

use App\OwnerPriceExpress;
use Faker\Generator as Faker;

$unit = \App\Unit::query()->first();
$factory->define(OwnerPriceExpress::class, function (Faker $faker)use(&$unit) {
    if (!$unit)$unit = \App\Unit::query()->first();
    return [
        "name" => $faker->name,                     //名称
        "initial_weight_unit_id" => $unit ? $unit->id : factory(\App\Unit::class),   //首重单位
        "additional_weight_unit_id" => $unit ? $unit->id : factory(\App\Unit::class),//续重单位
    ];
});
