Laravel Akismet
Install this package with composer:
php composer.phar require nickurt/laravel-akismet:1.*
Add the provider to config/app.php file
'nickurt\Akismet\ServiceProvider',
and the facade in the file
'Akismet' => 'nickurt\Akismet\Facade',
Copy the config files for the api
php artisan vendor:publish --provider="nickurt\Akismet\ServiceProvider" --tag="config"
if( \Akismet::validateKey() ) {
// valid
} else {
// invalid
}
\Akismet::setCommentAuthor("John Doe")
->setCommentAuthorUrl("https://www.google.com")
->setCommentContent("It's me, John!")
->setCommentType('registration');
// etc
// or
\Akismet::setCommentAuthor("John Doe");
\Akismet::setCommentAuthorUrl("https://www.google.com");
\Akismet::setCommentContent("It's me, John!");
// etc
if( \Akismet::getCommentAuthor() == 'John Doe' ) {
// it's me John!
}
if( \Akismet::isSpam() ) {
// yes, i'm spam!
}
if( \Akismet::reportSpam() ) {
// yes, thanks!
}
if( \Akismet::reportHam() ) {
// yes, thanks!
}
bin/phpunit nickurt/laravel-akismet/tests