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 1010
1111namespace Biscolab \ReCaptcha ;
1212
13+ use Illuminate \Support \Facades \Route ;
1314use Illuminate \Support \ServiceProvider ;
1415use Validator ;
1516
@@ -32,8 +33,8 @@ class ReCaptchaServiceProvider extends ServiceProvider {
3233 public function boot () {
3334
3435 $ this ->addValidationRule ();
35- $ this ->loadRoutesFrom (__DIR__ . '/routes/routes.php ' );
36-
36+ // $this->loadRoutesFrom(__DIR__ . '/routes/routes.php');
37+ $ this -> registerRoutes ();
3738 $ this ->publishes ([
3839 __DIR__ . '/../config/recaptcha.php ' => config_path ('recaptcha.php ' ),
3940 ]);
@@ -65,6 +66,31 @@ public function register() {
6566 $ this ->registerReCaptchaBuilder ();
6667 }
6768
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+
6894 /**
6995 * Register the HTML builder instance.
7096 *
@@ -93,14 +119,4 @@ protected function registerReCaptchaBuilder() {
93119 });
94120 }
95121
96- /**
97- * Get the services provided by the provider.
98- *
99- * @return array
100- */
101- public function provides () {
102-
103- return ['recaptcha ' ];
104- }
105-
106122}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments