https://github.com/phrenotype/figleaf
Keep bots and unwanted humans away from your website
https://github.com/phrenotype/figleaf
csrf csrf-form csrf-protection figleaf php php-csrf
Last synced: 20 days ago
JSON representation
Keep bots and unwanted humans away from your website
- Host: GitHub
- URL: https://github.com/phrenotype/figleaf
- Owner: phrenotype
- License: mit
- Created: 2022-01-01T17:57:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-15T19:45:05.000Z (about 3 years ago)
- Last Synced: 2025-06-09T08:46:42.208Z (12 months ago)
- Topics: csrf, csrf-form, csrf-protection, figleaf, php, php-csrf
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FigLeaF




This library keeps bots and unwanted humans from making requests to your website.
It offers full csrf token generation and validation, without external dependencies.
With this, a brute force attack is only possible with browser automation, hence increased cost.
## Install
`composer require figleaf/figleaf`
## Usage
To generate a csrf token for some random use ( you decide )
```php
```
Again, to get an input based on the old or current value, use `FigLeaf::input()`.
You can then go on to add the input to your form or web request as the case may be.
## Validation
After a form is submitted or a request is sent by a user, you validate it by passing an associative array based on the request medium
```php
passed()){
// Do something
}
if($validator->failed()){
// Do something
}
```
## Recommendation
It is highly recommeded you always generate new tokens per request, otherwise, this whole 'keeping bots and unwanted humans' away thing will just be an empty promise.
## Contact
**Email** : paul.contrib@gmail.com