32 lines
497 B
PHP
32 lines
497 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Modules\Production\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
|
||
|
|
|
||
|
|
class RecipeItem extends Model
|
||
|
|
{
|
||
|
|
use HasFactory;
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'recipe_id',
|
||
|
|
'product_id',
|
||
|
|
'quantity',
|
||
|
|
'unit_id',
|
||
|
|
'remark',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'quantity' => 'decimal:4',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function recipe()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Recipe::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|