1. Go to this page and download the library: Download vvb/yandex-smart-captcha library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vvb / yandex-smart-captcha example snippets
use vvb\YandexSmartCaptcha\Rules\YandexSmartCaptchaRule;
public function store(Request $request)
{
$request->validate([
'smart-token' => [new YandexSmartCaptchaRule],
]);
// Ваша логика
}
new YandexSmartCaptchaRule(
message: 'Неверная капча!',
emptyMessage: 'Пожалуйста, пройдите проверку'
)
use Illuminate\Http\Request;
use vvb\YandexSmartCaptcha\Rules\YandexSmartCaptchaRule;
class FormController extends Controller
{
public function showForm()
{
return view('form');
}
public function submitForm(Request $request)
{
$request->validate([
'email' => '->with('success', 'Форма успешно отправлена!');
}
}