app/Models/Recipe.php: add spell relationship.
This commit is contained in:
parent
78d5d8d50e
commit
86a0474a89
3 changed files with 29 additions and 1 deletions
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
|||
Reference in a new issue