1
0
Fork 0

app/Models/Item.php: change recipe relationship from belongsTo to hasMany.

This commit is contained in:
Henrik Hautakoski 2021-07-23 13:33:10 +02:00
parent 7df1e8345d
commit d3eccc596f
2 changed files with 11 additions and 5 deletions

View file

@ -42,9 +42,9 @@ class Item extends Model
return 'slug';
}
public function recipe()
public function recipes()
{
return $this->belongsTo(Recipe::class, 'id');
return $this->hasMany(Recipe::class);
}
public function getQuantityAttribute()