Introduction | laravel-honeypot-rust | Spatie       

 SPATIE  

laravel-honeypot-rust
=====================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-honeypot-rust](https://spatie.be/docs/laravel-honeypot-rust/v1)  Introduction

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/laravel-honeypot-rust/v1) 

  Introduction    
- [ Introduction ](https://spatie.be/docs/laravel-honeypot-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-honeypot-rust/v1/support-us)
- [ Installation ](https://spatie.be/docs/laravel-honeypot-rust/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/laravel-honeypot-rust/v1/usage)
- [ Testing ](https://spatie.be/docs/laravel-honeypot-rust/v1/testing)
- [ Changelog ](https://spatie.be/docs/laravel-honeypot-rust/v1/changelog)

  Laravel-honeypot-rust 
=======================

 Preventing spam submitted through forms 

### Useful links

- [Repository](https://github.com/spatie/laravel-honeypot-rust)
- [Discussions](https://github.com/spatie/laravel-honeypot-rust/discussions)

Introduction
------------

Protect form submissions with an empty field that bots tend to fill and an encrypted token that records when the form was rendered. The token authenticates the randomized field name and form scope, so a client cannot rename the field or backdate the form.

- `Honeypot` generates template data and implements a framework validation rule.
- `ProtectAgainstSpam` checks URL-encoded, JSON, and multipart POST bodies before a handler runs. URL-encoded and JSON checks preserve duplicate fields and raw whitespace; multipart uses the framework's parsed input and uploaded files.
- `service_provider()` uses package-tools to register environment-backed config defaults and an injectable `Honeypot`. Applications can override both.
- Defaults require both fields and allow submission from one second through two hours after rendering.
- Failed checks dispatch `SpamDetectedEvent` and return a blank successful page. Applications can select a generic 422 response or their own responder and checker.
- Settings are validated when constructing protection. Body reading and size errors retain the framework's status codes.

The package does not replace CSRF, account validation, throttling, or authentication. A client that obtains a valid form and waits can submit it. Tokens are not single-use or session-bound.

Continue with [installation](installation-and-setup) and [usage](usage).

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
