This repository was archived by the owner on Jun 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-26
lines changed Expand file tree Collapse file tree 2 files changed +28
-26
lines changed Original file line number Diff line number Diff line change 10
10
11
11
namespace Biscolab \ReCaptcha ;
12
12
13
+ use Illuminate \Support \Facades \Route ;
13
14
use Illuminate \Support \ServiceProvider ;
14
15
use Validator ;
15
16
@@ -32,8 +33,8 @@ class ReCaptchaServiceProvider extends ServiceProvider {
32
33
public function boot () {
33
34
34
35
$ this ->addValidationRule ();
35
- $ this ->loadRoutesFrom (__DIR__ . '/routes/routes.php ' );
36
-
36
+ // $this->loadRoutesFrom(__DIR__ . '/routes/routes.php');
37
+ $ this -> registerRoutes ();
37
38
$ this ->publishes ([
38
39
__DIR__ . '/../config/recaptcha.php ' => config_path ('recaptcha.php ' ),
39
40
]);
@@ -65,6 +66,31 @@ public function register() {
65
66
$ this ->registerReCaptchaBuilder ();
66
67
}
67
68
69
+ /**
70
+ * Get the services provided by the provider.
71
+ *
72
+ * @return array
73
+ */
74
+ public function provides (): array {
75
+
76
+ return ['recaptcha ' ];
77
+ }
78
+
79
+ /**
80
+ * @return ReCaptchaServiceProvider
81
+ *
82
+ * @since v3.4.1
83
+ */
84
+ protected function registerRoutes (): ReCaptchaServiceProvider {
85
+
86
+ Route::get (
87
+ config ('recaptcha.default_validation_route ' , 'biscolab-recaptcha/validate ' ),
88
+ ['uses ' => 'Biscolab\ReCaptcha\Controllers\ReCaptchaController@validateV3 ' ]
89
+ )->middleware ('web ' );
90
+
91
+ return $ this ;
92
+ }
93
+
68
94
/**
69
95
* Register the HTML builder instance.
70
96
*
@@ -93,14 +119,4 @@ protected function registerReCaptchaBuilder() {
93
119
});
94
120
}
95
121
96
- /**
97
- * Get the services provided by the provider.
98
- *
99
- * @return array
100
- */
101
- public function provides () {
102
-
103
- return ['recaptcha ' ];
104
- }
105
-
106
122
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments