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;
|
|
|
|
|
|
2021-03-23 14:51:37 +01:00
|
|
|
/**
|
|
|
|
|
* 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()
|
|
|
|
|
{
|
2021-03-17 09:28:02 +01:00
|
|
|
return $this->belongsTo(Product::class);
|
2021-03-16 17:48:35 +01:00
|
|
|
}
|
2021-04-26 14:08:02 +02: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()
|
|
|
|
|
{
|
2021-04-26 14:08:02 +02:00
|
|
|
return $this->hasOne(XmlInco::class, 'id', 'no_art');
|
|
|
|
|
}
|
2021-03-16 17:48:35 +01:00
|
|
|
}
|