Add user page.
This commit is contained in:
parent
ecc35c6fe6
commit
2f215d0b82
5 changed files with 81 additions and 0 deletions
|
|
@ -57,6 +57,15 @@ class User extends Authenticatable
|
|||
return $this->belongsTo(Character::class, 'character_id');
|
||||
}
|
||||
|
||||
public function alt_characters()
|
||||
{
|
||||
$relation = $this->characters();
|
||||
if ($this->character_id) {
|
||||
$relation->where('id', '!=', $this->character_id);
|
||||
}
|
||||
return $relation;
|
||||
}
|
||||
|
||||
public function characters()
|
||||
{
|
||||
return $this->hasMany(Character::class);
|
||||
|
|
|
|||
Reference in a new issue