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.token
orform
middleware to a forms target route
The
form
middleware group simply combinesform.honeypot
andform.token
so you don't have to. Using justform.token
protection without theform.honeypot
middleware or vise versa is supported.
- Use one of the corresponding frontend libraries to make form token requests
Lighthouse GraphQL API
-
Add the
form.token.handle
middleware to thelighthouse.route.middleware
config -
Register the honeypot scalar in your
graphql/schema.graphql
file - Add a honeypot field to any input that you want to protect against SPAM
The
field
config is not being used in GraphQL context.
-
Add the
@requireFormToken
directive 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 ^9.0