Skip to content

Commit 155d8b0

Browse files
committed
added comments
1 parent e9593db commit 155d8b0

File tree

11 files changed

+43
-200
lines changed

11 files changed

+43
-200
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ Ryandadeng\Securepayframe\SecurePayFrameServiceProvider::class
3939

4040
If your Laravel framework version is >= 5.5, just run the following command to publish views and config.
4141
```sh
42-
$ php artisan vendor:publish --provider="RyanDeng\GoogleReCaptcha\GoogleReCaptchaServiceProvider"
42+
$ php artisan vendor:publish --provider="RyanDeng\GoogleReCaptcha\Providers\GoogleReCaptchaV3ServiceProvider"
4343
```
4444

45-
After installation, you should see a googlerecaptcha/googlerecaptcha.blade file in your views folder and googlerecaptchav3.php in your app/config folder.
45+
After installation, you should see a googlerecaptcha/googlerecaptchav3.blade file in your views folder and googlerecaptchav3.php in your app/config folder.
4646

4747
If you want to change the default template, please check Advanced Usage.
4848

@@ -90,7 +90,7 @@ For more details please check comments in config file.
9090

9191

9292
```
93-
GoogleReCaptcha::setAction($action)->verifyResponse($response, $ip);
93+
GoogleReCaptchaV3::setAction($action)->verifyResponse($response, $ip);
9494
```
9595

9696
$action: Google reCAPTCHA definition

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
"extra": {
4040
"laravel": {
4141
"providers": [
42-
"RyanDeng\\GoogleReCaptcha\\Providers\\GoogleReCaptchaServiceProvider"
42+
"RyanDeng\\GoogleReCaptcha\\Providers\\GoogleReCaptchaV3ServiceProvider"
4343
],
4444
"aliases": {
45-
"GoogleReCaptcha": "RyanDeng\\GoogleReCaptcha\\Facades\\GoogleReCaptcha"
45+
"GoogleReCaptchaV3": "RyanDeng\\GoogleReCaptcha\\Facades\\GoogleReCaptchaV3"
4646
}
4747
}
4848
}

config/googlerecaptcha.php renamed to config/googlerecaptchav3.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
| Google reCAPTCHA host name, https://www.google.com/recaptcha/admin
2323
|
2424
*/
25-
'host_name' => 'ryandeng.test',
25+
'host_name' => '',
2626
/*
2727
|--------------------------------------------------------------------------
2828
| Secret Key
@@ -50,7 +50,7 @@
5050
| your value should be template.test
5151
|
5252
*/
53-
'template' => 'googlerecaptcha.googlerecaptcha',
53+
'template' => '',
5454
/*
5555
|--------------------------------------------------------------------------
5656
| Score Comparision

src/Configurations/ReCaptchaConfig.php renamed to src/Configurations/ReCaptchaConfigV3.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,80 +3,80 @@
33
namespace RyanDeng\GoogleReCaptcha\Configurations;
44

55

6-
use RyanDeng\GoogleReCaptcha\Interfaces\ReCaptchaConfigInterface;
6+
use RyanDeng\GoogleReCaptcha\Interfaces\ReCaptchaConfigV3Interface;
77

8-
class ReCaptchaConfig implements ReCaptchaConfigInterface
8+
class ReCaptchaConfigV3 implements ReCaptchaConfigV3Interface
99
{
1010
/**
1111
* @return string
1212
*/
1313
public function isServiceEnabled()
1414
{
15-
return config('googlerecaptcha.site_key');
15+
return config('googlerecaptchav3.site_key');
1616
}
1717

1818
/**
1919
* @return string
2020
*/
2121
public function getSiteVerifyUrl()
2222
{
23-
return config('googlerecaptcha.site_verify_url');
23+
return config('googlerecaptchav3.site_verify_url');
2424
}
2525

2626
/**
2727
* @return string
2828
*/
2929
public function getHostName()
3030
{
31-
return config('googlerecaptcha.host_name');
31+
return config('googlerecaptchav3.host_name');
3232
}
3333

3434
/**
3535
* @return bool
3636
*/
3737
public function isScoreEnabled()
3838
{
39-
return config('googlerecaptcha.is_score_enabled');
39+
return config('googlerecaptchav3.is_score_enabled');
4040
}
4141

4242
/**
4343
* @return string
4444
*/
4545
public function getSecretKey()
4646
{
47-
return config('googlerecaptcha.secret_key');
47+
return config('googlerecaptchav3.secret_key');
4848
}
4949

5050
/**
5151
* @return int
5252
*/
5353
public function getCurlTimeout()
5454
{
55-
return config('googlerecaptcha.options.curl_timeout');
55+
return config('googlerecaptchav3.options.curl_timeout');
5656
}
5757

5858
/**
5959
* @return bool
6060
*/
6161
public function getCurlVerify()
6262
{
63-
return config('googlerecaptcha.options.curl_verify');
63+
return config('googlerecaptchav3.options.curl_verify');
6464
}
6565

6666
/**
6767
* @return string
6868
*/
6969
public function getTemplate()
7070
{
71-
return config('googlerecaptcha.template');
71+
return config('googlerecaptchav3.template');
7272
}
7373

7474
/**
7575
* @return string
7676
*/
7777
public function getSiteKey()
7878
{
79-
return config('googlerecaptcha.site_key');
79+
return config('googlerecaptchav3.site_key');
8080
}
8181

8282

@@ -86,7 +86,7 @@ public function getSiteKey()
8686
public function getOptions()
8787
{
8888

89-
return config('googlerecaptcha.options');
89+
return config('googlerecaptchav3.options');
9090
}
9191

9292

@@ -95,6 +95,6 @@ public function getOptions()
9595
*/
9696
public function getScoreSetting()
9797
{
98-
return config('googlerecaptcha.score_setting');
98+
return config('googlerecaptchav3.score_setting');
9999
}
100100
}

src/Core/ReCaptchaResponse.php renamed to src/Core/GoogleReCaptchaV3Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use Carbon\Carbon;
1313

14-
class ReCaptchaResponse
14+
class GoogleReCaptchaV3Response
1515
{
1616
protected $success;
1717
protected $score;

src/Facades/GoogleReCaptcha.php renamed to src/Facades/GoogleReCaptchaV3.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
namespace RyanDeng\GoogleReCaptcha\Facades;
44

55
use Illuminate\Support\Facades\Facade;
6-
use RyanDeng\GoogleReCaptcha\Core\ReCaptchaResponse;
6+
use RyanDeng\GoogleReCaptcha\Core\GoogleReCaptchaV3Response;
77

88
/**
9-
* @method static ReCaptchaResponse verifyResponse(array $data)
10-
* @method static \RyanDeng\GoogleReCaptcha\GoogleReCaptcha setAction(string $value)
9+
* @method static GoogleReCaptchaV3Response verifyResponse(array $data)
10+
* @method static \RyanDeng\GoogleReCaptcha\GoogleReCaptchaV3 setAction(string $value)
1111
* @method static render(...$names)
1212
* @see ReCaptcha
1313
*/
14-
class GoogleReCaptcha extends Facade
14+
class GoogleReCaptchaV3 extends Facade
1515
{
1616
/**
1717
* Get the registered name of the component.
@@ -20,6 +20,6 @@ class GoogleReCaptcha extends Facade
2020
*/
2121
protected static function getFacadeAccessor()
2222
{
23-
return 'GoogleReCaptcha';
23+
return 'GoogleReCaptchaV3';
2424
}
2525
}

src/GoogleReCaptcha.php

Lines changed: 0 additions & 157 deletions
This file was deleted.

src/Interfaces/ReCaptchaConfigInterface.php renamed to src/Interfaces/ReCaptchaConfigV3Interface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace RyanDeng\GoogleReCaptcha\Interfaces;
1010

1111

12-
interface ReCaptchaConfigInterface
12+
interface ReCaptchaConfigV3Interface
1313
{
1414

1515
/**

0 commit comments

Comments
 (0)