ldc-loue/database/factories/IncoNutritionalValueFactory.php
Jérémy Munsch aadb5c0acc Sprint2
2022-07-18 08:24:42 +00:00

50 lines
1.8 KiB
PHP

<?php
namespace Database\Factories;
use App\Models\IncoNutritionalValue;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh
*/
class IncoNutritionalValueFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = IncoNutritionalValue::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
"weight" => $this->faker->boolean(10) ?
null : $this->faker->numberBetween(231 - 150, 231 + 150),
"energy" => $this->faker->boolean(10) ?
null : $this->faker->numberBetween(231 - 150, 231 + 150),
"energy_kj" => $this->faker->boolean(10) ?
null : $this->faker->numberBetween(964 - 150, 964 + 150),
"protein" => $this->faker->boolean(10) ?
null : $this->faker->numberBetween(9.2 - 3, 9.2 + 15),
"carbohydrates" => $this->faker->boolean(10) ?
null : $this->faker->numberBetween(20 - 10, 20 + 25),
"sugar" => $this->faker->boolean(10) ?
null : $this->faker->numberBetween(1.5 - 1, 1.5 + 6),
"fat" => $this->faker->boolean(10) ?
null : $this->faker->numberBetween(12 - 6, 12 + 6),
"saturated_fatty_acids" => $this->faker->boolean(10) ?
null : $this->faker->numberBetween(3.4 - 2, 3.4 + 6),
"dietary_fiber" => $this->faker->boolean(10) ?
null : $this->faker->numberBetween(2.9 - 2, 2.9 + 6),
"salt" => $this->faker->boolean(10) ?
null : $this->faker->numberBetween(1.1 - 1, 1.1 + 1.1)
];
}
}