<?php

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

use App\ProcessMethod;
use Faker\Generator as Faker;

$unit = \App\Unit::query()->first();
$factory->define(ProcessMethod::class, function (Faker $faker)use(&$unit) {
    if (!$unit)$unit = \App\Unit::query()->first();
    return [
        'name' => $faker->name,
        "unit_id" => $unit ? $unit->id : factory(\App\Unit::class),
        "unit_price" => mt_rand(10,50) / 9,
    ];
});
