Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2021-03-16 (5 months ago) | | Not yet rated by the users | | Total: 25 | | All time: 10,318 This week: 259 |
|
Description | | Author |
This package can validate human users using Recaptcha API.
It can display form inputs to validate whether the current user accessing a page is a real human user.
The class can also perform the necessary checks after the user has submitted the form to determine if he passed the human validation using Recaptcha. | |
|
|
Innovation award
Nominee: 7x |
|
Details
Laravel Recaptcha
installation
composer require isaeken/recaptcha
usage
frontend
blade
<form action="?" method="GET">
@csrf
<img src="{{ route('isaeken.recaptcha.image') }}" />
<input type="text" name="value">
<button submit>Check</button>
</form>
your own
public function index(Request $request)
{
$recaptcha = new Recaptcha;
$recaptcha->draw();
$recaptcha->setSession();
$recaptcha->dark(); // optional
return $recaptcha->response();
}
backend
public function index(Request $request)
{
$request->validate([
'value' => 'required|recaptcha'
]);
return 'ok';
}
alternative
public function index(Request $request)
{
$validate = IsaEken\Recaptcha\Recaptcha::validate(
$request->get('value'),
0, // tolerance,
false // ignore uppercase or lowercase
);
// or
$validate = IsaEken\Recaptcha\Recaptcha::validateOnce(
$request->get('value'),
0, // tolerance,
false // ignore uppercase or lowercase
);
}
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.