回答編集履歴
1
リレーションの命名規則に従い修正。
test
CHANGED
@@ -84,17 +84,17 @@
|
|
84
84
|
|
85
85
|
}
|
86
86
|
|
87
|
-
public function image() {
|
87
|
+
public function images() {
|
88
88
|
|
89
89
|
return $this->hasMany(Image::class);
|
90
90
|
|
91
91
|
}
|
92
92
|
|
93
|
-
protected $appends = ['image'];
|
93
|
+
protected $appends = ['images'];
|
94
94
|
|
95
|
-
public function getImageAttribute($value) {
|
95
|
+
public function getImagesAttribute($value) {
|
96
96
|
|
97
|
-
return $this->getRelationValue('image');
|
97
|
+
return $this->getRelationValue('images');
|
98
98
|
|
99
99
|
}
|
100
100
|
|