Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cleantalk/laravel-antispam
https://github.com/cleantalk/laravel-antispam
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/cleantalk/laravel-antispam
- Owner: CleanTalk
- Created: 2020-09-28T18:34:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-17T08:15:23.000Z (4 months ago)
- Last Synced: 2024-11-17T03:36:21.447Z (about 2 months ago)
- Language: PHP
- Size: 289 KB
- Stars: 2
- Watchers: 6
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# laravel-antispam
## How to use:
1) Require the `cleantalk/laravel-antispam` module
2) Register the `CleantalkServiceProvider` service provider into your app.php
3) Register the `cleantalk_antispam` middleware into your Kernel.php
4) Load the publishes by `php artisan vendor:publish` command
5) Edit `config/cleantalk.php` configuration file
6) Include JS into your root blade template (into head block) `@include('cleantalk::cleantalk')`
7) Add the middleware to your routes which requires the anti-spam protection (usually form hanled route)## Details:
1) Open the terminal in the root of your laravel application and run command to require anti-spam module: `composer require cleantalk/laravel-antispam`
2) Edit `config/app.php` file, add new service provider to the `providers` array: `cleantalk\antispam\CleantalkServiceProvider::class` ![Adding service provider](https://raw.githubusercontent.com/CleanTalk/laravel-antispam/master/documentation/screenshots/1.png)
3) Edit `app/Http/Kernel.php` file, add new middleware to the `$routeMiddleware` array: `'cleantalk_antispam' => \cleantalk\antispam\CleantalkValidate::class` ![Adding middleware](https://raw.githubusercontent.com/CleanTalk/laravel-antispam/master/documentation/screenshots/2.png)
4) Open the terminal in the root of your laravel application and run command to generate config file and javascript asset: `php artisan vendor:publish`
5) Edit newly added configuration file `config/cleantalk.php`, type your access key and change `enabled` key to `true` ![Changing configuration](https://raw.githubusercontent.com/CleanTalk/laravel-antispam/master/documentation/screenshots/3.png)
6) Include cleantalk blade template to your root blade template into block: `@include('cleantalk::cleantalk')` ![Adding blade template](https://raw.githubusercontent.com/CleanTalk/laravel-antispam/master/documentation/screenshots/4.png)
7) So finally add the middleware to the required routes: `->middleware('cleantalk_antispam')` ![Using middleware](https://raw.githubusercontent.com/CleanTalk/laravel-antispam/master/documentation/screenshots/5.png)Now you can test the protection on the route contains `cleantalk_antispam` middleware, just use [email protected] test email for email field.
## Requirements:
* CleanTalk account https://cleantalk.org/register?product=anti-spam