Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/v3'
Browse files Browse the repository at this point in the history
* release/v3:
  code comments
  routes folder removed
  Update README.md
  Load routes in ReCaptchaServiceProvider::registerRoutes method
  Update README.md
  Update README.md
  Update README.md
  • Loading branch information
biscolab committed Feb 14, 2019
2 parents 586ee56 + 29812e1 commit 6c113d7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 26 deletions.
40 changes: 28 additions & 12 deletions src/ReCaptchaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Biscolab\ReCaptcha;

use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Validator;

Expand All @@ -32,8 +33,8 @@ class ReCaptchaServiceProvider extends ServiceProvider {
public function boot() {

$this->addValidationRule();
$this->loadRoutesFrom(__DIR__ . '/routes/routes.php');

// $this->loadRoutesFrom(__DIR__ . '/routes/routes.php');
$this->registerRoutes();
$this->publishes([
__DIR__ . '/../config/recaptcha.php' => config_path('recaptcha.php'),
]);
Expand Down Expand Up @@ -65,6 +66,31 @@ public function register() {
$this->registerReCaptchaBuilder();
}

/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides(): array {

return ['recaptcha'];
}

/**
* @return ReCaptchaServiceProvider
*
* @since v3.4.1
*/
protected function registerRoutes(): ReCaptchaServiceProvider {

Route::get(
config('recaptcha.default_validation_route', 'biscolab-recaptcha/validate'),
['uses' => 'Biscolab\ReCaptcha\Controllers\ReCaptchaController@validateV3']
)->middleware('web');

return $this;
}

/**
* Register the HTML builder instance.
*
Expand Down Expand Up @@ -93,14 +119,4 @@ protected function registerReCaptchaBuilder() {
});
}

/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides() {

return ['recaptcha'];
}

}
14 changes: 0 additions & 14 deletions src/routes/routes.php

This file was deleted.

0 comments on commit 6c113d7

Please sign in to comment.