cleantalk / laravel-antispam
Anti-spam laravel extension by CleanTalk with protection against spam bots and manual spam.
Installs: 316
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 6
Forks: 4
Open Issues: 1
Type:laravel-extension
This package is auto-updated.
Last update: 2024-12-17 08:47:23 UTC
README
How to use:
- Require the
cleantalk/laravel-antispam
module - Register the
CleantalkServiceProvider
service provider into your app.php - Register the
cleantalk_antispam
middleware into your Kernel.php - Load the publishes by
php artisan vendor:publish
command - Edit
config/cleantalk.php
configuration file - Include JS into your root blade template (into head block)
@include('cleantalk::cleantalk')
- Add the middleware to your routes which requires the anti-spam protection (usually form hanled route)
Details:
- Open the terminal in the root of your laravel application and run command to require anti-spam module:
composer require cleantalk/laravel-antispam
- Edit
config/app.php
file, add new service provider to theproviders
array:cleantalk\antispam\CleantalkServiceProvider::class
- Edit
app/Http/Kernel.php
file, add new middleware to the$routeMiddleware
array:'cleantalk_antispam' => \cleantalk\antispam\CleantalkValidate::class
- Open the terminal in the root of your laravel application and run command to generate config file and javascript asset:
php artisan vendor:publish
- Edit newly added configuration file
config/cleantalk.php
, type your access key and changeenabled
key totrue
- Include cleantalk blade template to your root blade template into block:
@include('cleantalk::cleantalk')
- So finally add the middleware to the required routes:
->middleware('cleantalk_antispam')
Now you can test the protection on the route contains cleantalk_antispam
middleware, just use s@cleantalk.org test email for email field.
Requirements:
- CleanTalk account https://cleantalk.org/register?product=anti-spam