1
0
Fork 0

app/Models/User.php: do not reuse "characters" relationship to define "alt_characters" relationship, use a regular hasMany()

This commit is contained in:
Henrik Hautakoski 2021-08-28 15:06:08 +02:00
parent 77e8792edc
commit df08af6f7d

View file

@ -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);
}