lukeraymonddowning / honey

A spam prevention package for Laravel, providing honeypot techniques, ip blocking and beautifully simple Recaptcha integration. Stop spam. Use Honey.
MIT License
402 stars 23 forks source link

Allows you to use reCaptcha within the `<x-honey/>` component #6

Closed lukeraymonddowning closed 3 years ago

lukeraymonddowning commented 3 years ago

Previously, you would need to declare 2 components in a form if you wanted honey and recaptcha:

<form method="POST">
    @csrf

    <x-honey/>
    <x-honey-recaptcha action="submit"/>

    <input type="text" name="name">
    <input type="email" name="email">
    <input type="submit" value="Submit">
</form>

This PR allows you to optionally declare them in a single component by adding the recaptcha attribute to the <x-honey/> component.

<form method="POST">
    @csrf

    <x-honey recaptcha="submit"/>

    <input type="text" name="name">
    <input type="email" name="email">
    <input type="submit" value="Submit">
</form>
lukeraymonddowning commented 3 years ago

The README will need updating to reflect this, but I will wait until I have enough changes in to warrant creating a new release.