Skip to content

Commit

Permalink
fix json message
Browse files Browse the repository at this point in the history
  • Loading branch information
tojo-r27 committed Jul 9, 2021
1 parent 2d047a5 commit 635ac89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Create an account on https://www.hcaptcha.com for having `secret_key` and `site_
$response = Hcaptcha::verify($request->get('h-captcha-response'));
//add condition for response
if($response){
if($response->success){
$msg = "Robot verification success";
}else{
$msg = "Robot verification failed";
Expand Down
3 changes: 2 additions & 1 deletion src/Hcaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Codise\Hclaravel;

use Illuminate\Support\Facades\Http;
use Response;
use GuzzleHttp\Client;

class Hcaptcha
Expand All @@ -24,7 +25,7 @@ public static function verify($response) {
$json = json_decode($body);
return $json;
} catch(\Exception $e) {
return response()->json(['error' => $e->getMessage()]);
return Response::json(['error' => $e->getMessage()]);
}
}
}

0 comments on commit 635ac89

Please sign in to comment.