Archived
1
0
Fork 0

app/Models/Recipe.php: add spell relationship.

This commit is contained in:
Henrik Hautakoski 2021-07-07 16:27:03 +02:00
parent 78d5d8d50e
commit 86a0474a89
3 changed files with 29 additions and 1 deletions

View file

@ -32,7 +32,8 @@ class Recipe extends Model
protected $fillable = [
'profession_id',
'category_id',
'item_id'
'item_id',
'spell_id'
];
/**
@ -75,6 +76,14 @@ class Recipe extends Model
return $this->belongsTo(RecipeCategory::class, 'category_id');
}
/**
* What spell this recipe peforms.
*/
public function spell()
{
return $this->belongsTo(Spell::class);
}
/**
* What item this recipe crafts.
*/