Honeypot
Input::make('Street') //name the field to something that a bot has a high likelihood to auto populate
->rootAttr([ 'class' => 'hidden' ], false) //hides the fields root wrapper
->type('hidden')
->autocomplete('srteet') //deliberately misspelled autocomplete to avoid browser autofilling value in the honeypot
->custom() //make the field custom, to ignore it when saving the model
->class('nosy') //this class exists in the theme.css, makes the field hidden
->default('') //the honeypot should be empty
->rules('nullable|regex:/^$/i') //the form will not be saved if the field has a valueThe .nosy class exists in the theme.css file:
.nosy class exists in the theme.css file:/* honeypot field class */
.nosy {
position: absolute;
opacity: 0;
}Last updated
Was this helpful?