ldc-boutique-cnc/app/Models/FoodProduct.php

41 lines
764 B
PHP
Raw Permalink Normal View History

2021-03-16 17:48:35 +01:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class FoodProduct extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'product_id',
];
2022-09-03 16:56:16 +02:00
/**
* BelongsTo product relation
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
2022-08-25 12:26:43 +02:00
public function product()
{
return $this->belongsTo(Product::class);
2021-03-16 17:48:35 +01:00
}
2022-09-03 16:56:16 +02:00
/**
* hasOne product relation
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
2022-08-25 12:26:43 +02:00
public function xmlInco()
{
return $this->hasOne(XmlInco::class, 'id', 'no_art');
}
2021-03-16 17:48:35 +01:00
}