28 lines
691 B
PHP
28 lines
691 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Cutting;
|
|
use App\Models\CuttingMaterial;
|
|
use App\Models\RawMaterialPrice;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<CuttingMaterial>
|
|
*/
|
|
class CuttingMaterialFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
$materialUsage = fake()->randomFloat(4, 1, 25);
|
|
$remainingMaterial = fake()->randomFloat(4, 0, 10);
|
|
|
|
return [
|
|
'cutting_id' => Cutting::factory(),
|
|
'raw_material_price_id' => RawMaterialPrice::factory(),
|
|
'material_usage' => $materialUsage,
|
|
'remaining_material' => $remainingMaterial,
|
|
];
|
|
}
|
|
}
|