PHP code example of breadthe / laravel-silent-spam-filter

1. Go to this page and download the library: Download breadthe/laravel-silent-spam-filter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

breadthe / laravel-silent-spam-filter example snippets

bash
php artisan vendor:publish --provider="Breadthe\SilentSpam\SilentSpamServiceProvider" --tag="silentspam-config"
 php
$spamMessage = 'This message contains spam';
$normalMessage = 'This is a normal message';

SilentSpam::blacklist([
    'contains spam',
]);

SilentSpam::isSpam($spamMessage); // true
SilentSpam::notSpam($spamMessage); // false

SilentSpam::isSpam($spamMessage); // false
SilentSpam::notSpam($spamMessage); // true