This repository has been archived on 2025-12-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2025-11-26 10:05:43 +01:00

25 lines
674 B
PHP

<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\Unit;
class LineItemFactory extends Factory
{
public function definition(): array
{
$isSection = rand(0, 10) > 7;
return [
'position' => $this->faker->numberBetween(1, 10) + ($isSection ? 0.5 : 0),
'is_section' => $isSection,
'title' => $this->faker->words(3, true),
'description' => $this->faker->sentence(),
'quantity' => $this->faker->numberBetween(1, 10),
'unit_id' => Unit::factory(),
'price' => $this->faker->randomFloat(2, 10, 500),
];
}
}