initial commit

This commit is contained in:
2026-06-29 13:00:18 +06:00
commit f2aea74471
3931 changed files with 562423 additions and 0 deletions

54
app/Rules/ReCaptcha.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
namespace App\Rules;
use App\Utility\Curl;
use Illuminate\Contracts\Validation\Rule;
class ReCaptcha implements Rule
{
/**
* Create a new rule instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
// google captcha url
$url = "https://www.google.com/recaptcha/api/siteverify";
// captcha secret key and value from the UI
$data = [
'secret' => config('app.GOOGLE_RECAPTCHA_SECRET'),
'response' => $value
];
$response = (new Curl($url))->get($data);
return $response['success'];
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return 'The validation error message.';
}
}