[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: ReCaptchaServiceProvider.php
<?php /** * Copyright (c) 2017 - present * LaravelGoogleRecaptcha - ReCaptchaServiceProvider.php * author: Roberto Belotti - roby.belotti@gmail.com * web : robertobelotti.com, github.com/biscolab * Initial version created on: 12/9/2018 * MIT license: https://github.com/biscolab/laravel-recaptcha/blob/master/LICENSE */ namespace Biscolab\ReCaptcha; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Validator; use Illuminate\Support\ServiceProvider; /** * Class ReCaptchaServiceProvider * @package Biscolab\ReCaptcha */ class ReCaptchaServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = false; /** * */ public function boot() { $this->addValidationRule(); $this->registerRoutes(); $this->publishes([ __DIR__ . '/../config/recaptcha.php' => config_path('recaptcha.php'), ], 'config'); } /** * Extends Validator to include a recaptcha type */ public function addValidationRule() { $message = null; if (!config('recaptcha.empty_message')) { $message = trans(config('recaptcha.error_message_key')); } Validator::extendImplicit(recaptchaRuleName(), function ($attribute, $value) { return app('recaptcha')->validate($value); }, $message); } /** * Register the service provider. * * @return void */ public function register() { $this->mergeConfigFrom( __DIR__ . '/../config/recaptcha.php', 'recaptcha' ); $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. * * @return void */ protected function registerReCaptchaBuilder() { $this->app->singleton('recaptcha', function ($app) { $recaptcha_class = ''; switch (config('recaptcha.version')) { case 'v3': $recaptcha_class = ReCaptchaBuilderV3::class; break; case 'v2': $recaptcha_class = ReCaptchaBuilderV2::class; break; case 'invisible': $recaptcha_class = ReCaptchaBuilderInvisible::class; break; } return new $recaptcha_class(config('recaptcha.api_site_key'), config('recaptcha.api_secret_key')); }); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.9 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002