From df08af6f7dab297708545733ca68fe8cac56ff4a Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sat, 28 Aug 2021 15:06:08 +0200 Subject: [PATCH] app/Models/User.php: do not reuse "characters" relationship to define "alt_characters" relationship, use a regular hasMany() --- app/Models/User.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Models/User.php b/app/Models/User.php index ae01551..0dd5b61 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -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); }