This commit is contained in:
2024-10-12 16:17:16 +02:00
commit 1bdefcff66
65 changed files with 10816 additions and 0 deletions

32
app/Models/Product.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
use HasFactory;
protected $guarded = ['id'];
protected $casts = [
'no_nutriments' => 'boolean',
'additives_n' => 'integer',
'ingredients_from_palm_oil_n' => 'integer',
'ingredients_that_may_be_from_palm_oil_n' => 'integer',
'nutriscore_score' => 'integer',
'nova_group' => 'integer',
];
public function ingredients()
{
return $this->hasMany(Ingredient::class);
}
public function nutritionFacts()
{
return $this->hasMany(NutritionFact::class);
}
}