lukeraymonddowning / honey

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

Undefined array key "honey_time" #40

Closed yanuarpmbd closed 2 years ago

yanuarpmbd commented 2 years ago

Hi, I got some error when integrating with livewire.

ErrorException Undefined array key "honey_time" http://127.0.0.1:8000/

I'm following installation step with default config

<form wire:submit.prevent="store">
    @csrf
    <input type="text" class="block text-sm py-3 px-4" wire:model="text"/>
    <x-honey/>
    <button type="submit" class="py-3 w-64">Submit</button>
</form>

My routes

Route::get('/form', \App\Http\Livewire\Form::class,)->middleware(['honey'])->name('form');

What's wrong here?

kiritokatklian commented 2 years ago

Make sure to use the middleware on a POST route and not GET.

yanuarpmbd commented 2 years ago

Big thanks @kiritokatklian