Skip to content

Commit

Permalink
Merge branch '2.1' of github.com:doublethreedigital/runway into 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Jul 30, 2021
2 parents 12dd24e + 85a3b7d commit c6d579a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Http/Controllers/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function store(StoreRequest $request, $resourceHandle)

$processedValue = $field->fieldtype()->process($request->get($fieldKey));

if (is_array($processedValue)) {
if (is_array($processedValue) && !$record->hasCast($fieldKey, ['array', 'collection', 'object', 'encrypted:array', 'encrypted:collection', 'encrypted:object'])) {
$processedValue = json_encode($processedValue);
}

Expand Down Expand Up @@ -158,7 +158,7 @@ public function update(UpdateRequest $request, $resourceHandle, $record)

$processedValue = $field->fieldtype()->process($request->get($fieldKey));

if (is_array($processedValue)) {
if (is_array($processedValue) && !$record->hasCast($fieldKey, ['array', 'collection', 'object', 'encrypted:array', 'encrypted:collection', 'encrypted:object'])) {
$processedValue = json_encode($processedValue);
}

Expand Down

0 comments on commit c6d579a

Please sign in to comment.