From 40f408115d0dcf1650a39db8788391aa91ac6c5f Mon Sep 17 00:00:00 2001 From: Leonard Smith Date: Wed, 7 Oct 2020 11:06:52 -0500 Subject: [PATCH] Fix relationship between Word and LexicalEntry --- app/LexicalEntry.php | 2 +- app/Word.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/LexicalEntry.php b/app/LexicalEntry.php index a1ffc23..8db9615 100644 --- a/app/LexicalEntry.php +++ b/app/LexicalEntry.php @@ -27,6 +27,6 @@ class LexicalEntry extends Model */ public function words() { - return $this->hasMany(Word::class, 'strongs_number'); + return $this->hasMany(Word::class,'strongs_number', 'id'); } } diff --git a/app/Word.php b/app/Word.php index ea1720c..03450b5 100644 --- a/app/Word.php +++ b/app/Word.php @@ -35,8 +35,11 @@ class Word extends Model return $this->belongsTo(Word::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function lexicalEntry() { - return $this->belongsTo(LexicalEntry::class, 'id', 'strongs_number'); + return $this->belongsTo(LexicalEntry::class, 'strongs_number', 'id'); } }