app/Models/CharacterProfession.php: Add specialization relationship
This commit is contained in:
parent
5314028388
commit
ad66ef86ab
2 changed files with 8 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ class CharacterProfession extends Model
|
|||
protected $fillable = [
|
||||
'character_id',
|
||||
'profession_id',
|
||||
'specialization_id',
|
||||
'skill',
|
||||
];
|
||||
|
||||
|
|
@ -48,6 +49,11 @@ class CharacterProfession extends Model
|
|||
return $this->belongsTo(Profession::class);
|
||||
}
|
||||
|
||||
public function specialization()
|
||||
{
|
||||
return $this->belongsTo(Spell::class, 'specialization_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the character that has this profession.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue