Download the PHP package hettiger/spa-honeypot without Composer
On this page you can find all versions of the php package hettiger/spa-honeypot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hettiger/spa-honeypot
More information about hettiger/spa-honeypot
Files in hettiger/spa-honeypot
Package spa-honeypot
Short Description Honeypot package for Single Page Applications
License MIT
Homepage https://github.com/hettiger/spa-honeypot
Informations about the package spa-honeypot
Honeypot package for Single Page Applications
Helps to protect SPA's (Single Page Applications) against SPAM without using cookies or user input.
Installation
Usage
- Add the
form.honeypot,form.tokenorformmiddleware to a forms target route
The
formmiddleware group simply combinesform.honeypotandform.tokenso you don't have to. Using justform.tokenprotection without theform.honeypotmiddleware or vise versa is supported.
- Use one of the corresponding frontend libraries to make form token requests
Lighthouse GraphQL API
-
Add the
form.token.handlemiddleware to thelighthouse.route.middlewareconfig -
Register the honeypot scalar in your
graphql/schema.graphqlfile - Add a honeypot field to any input that you want to protect against SPAM
The
fieldconfig is not being used in GraphQL context.
-
Add the
@requireFormTokendirective to any field that you want to protect against SPAM - Use one of the corresponding frontend libraries to make form token requests
Customizing Responses
You may provide custom error response factories using the config:
Alternatively you can provide a simple Closure anywhere in your application:
You don't have to worry about adding the form token header yourself. It'll be added for you automatically.
Testing
Frontend Libraries
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of spa-honeypot with dependencies
spatie/laravel-package-tools Version ^1.13.0
illuminate/contracts Version ^10.0|^11.0|^12.0