app/Models/Item.php: change recipe relationship from belongsTo to hasMany.
This commit is contained in:
parent
7df1e8345d
commit
d3eccc596f
2 changed files with 11 additions and 5 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue