回答編集履歴
1
リレーションの命名規則に従い修正。
answer
CHANGED
@@ -41,12 +41,12 @@
|
|
41
41
|
public function base() {
|
42
42
|
return $this->morphMany(Base::class, 'ref');
|
43
43
|
}
|
44
|
-
public function
|
44
|
+
public function images() {
|
45
45
|
return $this->hasMany(Image::class);
|
46
46
|
}
|
47
|
-
protected $appends = ['
|
47
|
+
protected $appends = ['images'];
|
48
|
-
public function
|
48
|
+
public function getImagesAttribute($value) {
|
49
|
-
return $this->getRelationValue('
|
49
|
+
return $this->getRelationValue('images');
|
50
50
|
}
|
51
51
|
}
|
52
52
|
```
|