Skip to content

Commit

Permalink
Laravel 9 only support
Browse files Browse the repository at this point in the history
  • Loading branch information
hedii committed Mar 5, 2022
1 parent 423d3b3 commit 8871dea
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '7.4', '8.0', '8.1' ]
php-versions: [ '8.0', '8.1' ]
name: Testing on PHP ${{ matrix.php-versions }}
steps:
- name: Checkout
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
}
],
"require": {
"php": "^7.4.0|^8.0",
"ext-json": "*",
"laravel/framework": "^8.0",
"guzzlehttp/guzzle": "^6.0|^7.0"
"php": "^8.0",
"laravel/framework": "^9.0",
"guzzlehttp/guzzle": "^7.2"
},
"require-dev": {
"orchestra/testbench": "^6.0"
"orchestra/testbench": "^7.0"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 0 additions & 5 deletions src/Facades/Recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class Recaptcha extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor(): string
{
return 'recaptcha';
Expand Down
22 changes: 1 addition & 21 deletions src/Recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,24 @@ class Recaptcha
{
/**
* The http request instance.
*
* @var \Illuminate\Http\Request
*/
private Request $request;

/**
* The recaptcha site key.
*
* @var string
*/
private string $siteKey;

/**
* The recaptcha secret key.
*
* @var string
*/
private string $secretKey;

/**
* The minimum score a recaptcha response must have to be valid.
*
* @var float
*/
private float $minimumScore;

/**
* Recaptcha constructor.
*
* @param \Illuminate\Http\Request $request
* @param string $siteKey
* @param string $secretKey
* @param float $minimumScore
*/
public function __construct(Request $request, string $siteKey, string $secretKey, float $minimumScore)
{
$this->request = $request;
Expand All @@ -55,7 +39,7 @@ public function __construct(Request $request, string $siteKey, string $secretKey
/**
* Resolve the captcha score.
*
* @return bool
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function isValid(): bool
{
Expand Down Expand Up @@ -86,10 +70,6 @@ public function isValid(): bool

/**
* Get the required recaptcha js scripts.
*
* @param string|null $action
* @param string $elementId
* @return string
*/
public function script(?string $action = null, string $elementId = 'recaptchaResponse'): string
{
Expand Down
10 changes: 0 additions & 10 deletions src/RecaptchaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class RecaptchaServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register(): void
{
$this->mergeConfigFrom(__DIR__ . '/../config/recaptcha.php', 'recaptcha');
Expand All @@ -27,11 +22,6 @@ public function register(): void
$this->app->alias(Recaptcha::class, 'recaptcha');
}

/**
* Bootstrap services.
*
* @return void
*/
public function boot(): void
{
$this->publishes([__DIR__ . '/../config/recaptcha.php' => config_path('recaptcha.php')]);
Expand Down

0 comments on commit 8871dea

Please sign in to comment.