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.
2025-10-20 08:57:51 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
|
|
class LineItemFactory extends Factory
|
|
|
|
|
{
|
|
|
|
|
public function definition(): array
|
|
|
|
|
{
|
2025-11-19 10:12:45 +01:00
|
|
|
|
|
|
|
|
$isSection = rand(0, 10) > 7;
|
2025-10-20 08:57:51 +02:00
|
|
|
return [
|
2025-11-19 10:12:45 +01:00
|
|
|
'position' => $this->faker->numberBetween(1, 10) + ($isSection ? 0.5 : 0),
|
|
|
|
|
'is_section' => $isSection,
|
2025-10-20 08:57:51 +02:00
|
|
|
'title' => $this->faker->words(3, true),
|
|
|
|
|
'description' => $this->faker->sentence(),
|
|
|
|
|
'quantity' => $this->faker->numberBetween(1, 10),
|
|
|
|
|
'unit' => $this->faker->randomElement(['Stück', 'Stunden', 'Tage', 'pauschal']),
|
|
|
|
|
'price' => $this->faker->randomFloat(2, 10, 500),
|
|
|
|
|
];
|
|
|
|
|
}
|
2025-11-19 10:12:45 +01:00
|
|
|
}
|