@@ -23,7 +23,7 @@ class GoogleReCaptchaV3ServiceProvider extends ServiceProvider
23
23
*/
24
24
public function boot ()
25
25
{
26
- $ this ->loadViewsFrom (__DIR__ . '/../../resources/views ' , 'GoogleReCaptchaV3 ' );
26
+ $ this ->loadViewsFrom (__DIR__ . '/../../resources/views ' , 'GoogleReCaptchaV3 ' );
27
27
28
28
if ($ this ->app ->runningInConsole ()) {
29
29
$ this ->bootForConsole ();
@@ -38,37 +38,34 @@ public function boot()
38
38
public function register ()
39
39
{
40
40
$ this ->mergeConfigFrom (
41
- __DIR__ . '/../../config/googlerecaptchav3.php ' , 'googlerecaptchav3 '
41
+ __DIR__ . '/../../config/googlerecaptchav3.php ' , 'googlerecaptchav3 '
42
42
);
43
43
44
44
$ laravel = app ();
45
45
$ version = $ laravel ::VERSION ;
46
46
47
47
if (version_compare ($ version , '5.7.* ' ) === 1 || version_compare ($ version , '5.6.* ' ) === 1 || version_compare ($ version , '5.5.* ' ) === 1 ) {
48
-
49
- if (!$ this ->app ->has (ReCaptchaConfigV3Interface::class)) {
48
+ if (! $ this ->app ->has (ReCaptchaConfigV3Interface::class)) {
50
49
$ this ->bindConfig ();
51
50
}
52
51
53
- if (!$ this ->app ->has (RequestClientInterface::class)) {
52
+ if (! $ this ->app ->has (RequestClientInterface::class)) {
54
53
$ this ->bindRequest ($ this ->app ->get (ReCaptchaConfigV3Interface::class)->getRequestMethod ());
55
54
}
56
55
} else {
57
56
$ this ->bindConfig ();
58
57
$ this ->bindRequest (app (ReCaptchaConfigV3Interface::class)->getRequestMethod ());
59
58
}
60
59
61
-
62
60
$ this ->app ->bind ('GoogleReCaptchaV3 ' , function () {
63
61
$ service = new GoogleReCaptchaV3Service (app (ReCaptchaConfigV3Interface::class), app (RequestClientInterface::class));
64
62
65
63
return new GoogleReCaptchaV3 ($ service );
66
64
});
67
-
68
65
}
69
66
70
67
/**
71
- * Bind config
68
+ * Bind config.
72
69
*/
73
70
public function bindConfig ()
74
71
{
@@ -114,12 +111,12 @@ protected function bootForConsole()
114
111
{
115
112
// Publishing the configuration file.
116
113
$ this ->publishes ([
117
- __DIR__ . '/../../config/googlerecaptchav3.php ' => config_path ('googlerecaptchav3.php ' ),
114
+ __DIR__ . '/../../config/googlerecaptchav3.php ' => config_path ('googlerecaptchav3.php ' ),
118
115
], 'googlerecaptchav3.config ' );
119
116
120
117
// Publishing the vue component file.
121
118
$ this ->publishes ([
122
- __DIR__ . '/../../vuejs/GoogleReCaptchaV3.vue ' => resource_path ('js/components/googlerecaptchav3/GoogleReCaptchaV3.vue ' ),
119
+ __DIR__ . '/../../vuejs/GoogleReCaptchaV3.vue ' => resource_path ('js/components/googlerecaptchav3/GoogleReCaptchaV3.vue ' ),
123
120
], 'googlerecaptchav3.vuejs ' );
124
121
}
125
122
0 commit comments