app/Models/User.php: do not reuse "characters" relationship to define "alt_characters" relationship, use a regular hasMany()
This commit is contained in:
parent
77e8792edc
commit
df08af6f7d
1 changed files with 2 additions and 1 deletions
|
|
@ -60,7 +60,8 @@ class User extends Authenticatable
|
|||
|
||||
public function alt_characters()
|
||||
{
|
||||
$relation = $this->characters();
|
||||
$relation = $this->hasMany(Character::class);
|
||||
|
||||
if ($this->character_id) {
|
||||
$relation->where('id', '!=', $this->character_id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue