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
Caramel-CRM-Backup/database/factories/LineItemFactory.php
T

25 lines
674 B
PHP
Raw Normal View History

2025-10-20 08:57:51 +02:00
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
2025-11-26 10:05:43 +01:00
use App\Models\Unit;
2025-10-20 08:57:51 +02:00
class LineItemFactory extends Factory
{
public function definition(): array
{
$isSection = rand(0, 10) > 7;
2025-10-20 08:57:51 +02:00
return [
'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),
2025-11-26 10:05:43 +01:00
'unit_id' => Unit::factory(),
2025-10-20 08:57:51 +02:00
'price' => $this->faker->randomFloat(2, 10, 500),
];
}
}