Skip to content

Commit 8952b45

Browse files
authored
minor improvement on cognative load
1 parent eb3ec38 commit 8952b45

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Http/Resources/Contracts/AllowableFields.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,8 @@ protected function mapFieldData($request, $fields)
7979
});
8080

8181
foreach($missing as $field){
82-
if(!array_key_exists(Helpers::snake($field), $data)){
83-
if(method_exists($this->resource, 'get' . Helpers::camel($field) . 'Attribute')){
84-
$data[$field] = $this->resource->{'get' . Helpers::camel($field) . 'Attribute'}();
85-
}
82+
if(method_exists($this->resource, 'get' . Helpers::camel($field) . 'Attribute')){
83+
$data[$field] = $this->resource->{ Helpers::camel($field)};
8684
}
8785
}
8886

0 commit comments

Comments
 (0)