@@ -75,7 +75,7 @@ public function test_getting_a_list_of_resources_including_belongs_to_relation()
75
75
new ModelResource ,
76
76
[
77
77
[
78
- 'belongs_to_relation ' => $ matchingModel ->belongsToRelation ->only ((new BelongsToResource )->exposedFields (app ()->make (RestRequest::class))),
78
+ 'belongs_to_relation ' => $ matchingModel ->belongsToRelation ->only ((new BelongsToResource )->fields (app ()->make (RestRequest::class))),
79
79
],
80
80
[
81
81
'belongs_to_relation ' => null ,
@@ -116,11 +116,11 @@ public function test_getting_a_list_of_resources_including_belongs_to_has_many_r
116
116
[
117
117
'belongs_to_relation ' => array_merge (
118
118
$ matchingModelBelongsToRelation
119
- ->only ((new BelongsToResource )->exposedFields (app ()->make (RestRequest::class))),
119
+ ->only ((new BelongsToResource )->fields (app ()->make (RestRequest::class))),
120
120
[
121
121
'models ' => $ matchingModelBelongsToRelation ->models
122
122
->map (function ($ model ) {
123
- return $ model ->only ((new ModelResource )->exposedFields (app ()->make (RestRequest::class)));
123
+ return $ model ->only ((new ModelResource )->fields (app ()->make (RestRequest::class)));
124
124
})
125
125
->toArray (),
126
126
]
@@ -164,7 +164,7 @@ public function test_getting_a_list_of_resources_including_has_one_relation(): v
164
164
[
165
165
[
166
166
'has_one_relation ' => $ matchingModel ->hasOneRelation ->only (
167
- (new HasOneResource )->exposedFields (app ()->make (RestRequest::class))
167
+ (new HasOneResource )->fields (app ()->make (RestRequest::class))
168
168
),
169
169
],
170
170
[
@@ -205,7 +205,7 @@ public function test_getting_a_list_of_resources_including_has_one_of_many_relat
205
205
[
206
206
[
207
207
'has_one_of_many_relation ' => $ matchingModel ->hasOneOfManyRelation ->only (
208
- (new HasOneOfManyResource )->exposedFields (app ()->make (RestRequest::class))
208
+ (new HasOneOfManyResource )->fields (app ()->make (RestRequest::class))
209
209
),
210
210
],
211
211
[
@@ -252,7 +252,7 @@ public function test_getting_a_list_of_resources_including_has_many_relation():
252
252
->get ()
253
253
->map (function ($ relation ) {
254
254
return $ relation ->only (
255
- (new HasManyResource )->exposedFields (app ()->make (RestRequest::class))
255
+ (new HasManyResource )->fields (app ()->make (RestRequest::class))
256
256
);
257
257
})->toArray (),
258
258
],
@@ -298,7 +298,7 @@ public function test_getting_a_list_of_resources_including_belongs_to_many_relat
298
298
->get ()
299
299
->map (function ($ relation ) use ($ matchingModel , $ pivotAccessor ) {
300
300
return collect ($ relation ->only (
301
- array_merge ((new BelongsToManyResource )->exposedFields (app ()->make (RestRequest::class)), [$ pivotAccessor ])
301
+ array_merge ((new BelongsToManyResource )->fields (app ()->make (RestRequest::class)), [$ pivotAccessor ])
302
302
))
303
303
->pipe (function ($ relation ) use ($ matchingModel , $ pivotAccessor ) {
304
304
$ relation [$ pivotAccessor ] = collect ($ relation [$ pivotAccessor ]->toArray ())
0 commit comments