57 lines
1.4 KiB
PHP
57 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\Models\ActivityLog;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* @property double $energy Picto path.
|
|
* @property boolean $published Picto publish status.
|
|
* @property-read \Illuminate\Support\Carbon $created_at Created date.
|
|
* @property-read \Illuminate\Support\Carbon $updated_at Updated date.
|
|
*/
|
|
class IncoNutritionalValue extends Model
|
|
{
|
|
use ActivityLog;
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array<int, string>
|
|
*/
|
|
protected $fillable = [
|
|
'energy',
|
|
'energy_kj',
|
|
'protein',
|
|
'carbohydrates',
|
|
'sugar',
|
|
'fat',
|
|
'saturated_fatty_acids',
|
|
'dietary_fiber',
|
|
'salt',
|
|
'energy_percent',
|
|
'energy_kj_percent',
|
|
'protein_percent',
|
|
'carbohydrates_percent',
|
|
'sugar_percent',
|
|
'fat_percent',
|
|
'saturated_fatty_acids_percent',
|
|
'dietary_fiber_percent',
|
|
'salt_percent'
|
|
];
|
|
|
|
// * RELATIONSHIPS
|
|
|
|
/**
|
|
* Get all of the products for the range.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function product(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
{
|
|
return $this->belongsTo(Product::class, 'product_id');
|
|
}
|
|
}
|