Files
SpiceManagementSystem/app/Models/Spice.php
T
2026-09-11 01:17:47 +02:00

18 lines
362 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Spice extends Model
{
protected $fillable = ['name', 'quantity', 'unit'];
public function recipes()
{
return $this->belongsToMany(Recipe::class, 'recipes_spices')
->withPivot('amount_in_percent')
->withTimestamps();
}
}