Skip to content

Commit

Permalink
json encoding fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HergenD committed Aug 3, 2020
1 parent 5af049b commit 7399238
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/IdentityDocuments.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public static function parse(Request $request)
'back_img' => 'mimes:jpeg,png,jpg|max:5120',
]);
if ($validator->fails()) {
return [
'error' => $validator->errors()->first(),
'success' => false,
];
return json_encode([
"error" => $validator->errors()->first(),
"success" => false,
]);
}

$front_img = $request->front_img;
Expand All @@ -47,10 +47,10 @@ public static function parse(Request $request)
} elseif ($images->back_img) {
$full_img = Image::make($images->back_img);
} else {
return [
'error' => 'Missing images',
'success' => false,
];
return json_encode([
"error" => "Missing images",
"success" => false,
]);
}

$response = $imageAnnotator->textDetection((string) $full_img->encode());
Expand Down

0 comments on commit 7399238

Please sign in to comment.