1
0
Fork 0

app/Models/CharacterProfession.php: Add specialization relationship

This commit is contained in:
Henrik Hautakoski 2021-07-11 15:31:34 +02:00
parent 5314028388
commit ad66ef86ab
2 changed files with 8 additions and 0 deletions

View file

@ -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.
*/