eman1986/larakismet 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eman1986/larakismet

最新稳定版本:1.0.3

Composer 安装命令:

composer require eman1986/larakismet

包简介

Akismet Client for Laravel 5

README 文档

README

Total Downloads Latest Stable Version Latest Unstable Version License

Akismet Client for Laravel 5.

#Installation

simply include this library to your app's composer.json file in the request block:

"require": {
    "eman1986/larakismet": "dev-master",
}

Once you have the package loaded into your application's file system, open the config/app.php file and add the following line to the 'providers' array:

'larakismet\ServiceProviders\AkismetServiceProvider'

Add the facade of this package to the $aliases array.

'Akismet' => 'larakismet\Facades\Akismet'

run the following command in your terminal:

php artisan vendor:publish

This will create a config file for you where you can enter in the API Key (which if you don't have one, you'll need one, visit https://akismet.com) and enter in the address of your blog. You can also setup a debug mode to just test out the akismet API.

#What's Next?

After everything is all configured, you can now use the code in your application.

##checkSpam()

This will allow you to run a check on a comment post and ensure its not spam.

Akismet likes to have as much information as possible to properly determine if something is indeed Spam.

If you were to read the Akismet API on this, they ask for a lot of things but at a minimal you'll need the following set:

\Akismet::setCommentAuthor('John Doe');
\Akismet::setCommentAuthorEmail('email@example.com');
\Akismet::setPermalink('http://somesite.com/blog/sample-entry');
\Akismet::setCommentContent('Some content from form.');
\Akismet::checkSpam();

If you check out the source code you can see the other options available to zero in on the spammer, the Akismet API Guide is also a good reference..

##reportSpam()

You can help Akismet tackle spam by reporting it to them, this requires a smaller set of dat compared to the checkSpam() method.

\Akismet::setCommentAuthor('John Doe');
\Akismet::setCommentAuthorEmail('email@example.com');
\Akismet::setPermalink('http://somesite.com/blog/sample-entry');
\Akismet::setCommentContent('Some content from form.');
\Akismet::reportSpam();

##reportHam()

You can also report false positives to Akismet by doing the following:

\Akismet::setCommentAuthor('John Doe');
\Akismet::setCommentAuthorEmail('email@example.com');
\Akismet::setPermalink('http://somesite.com/blog/sample-entry');
\Akismet::setCommentContent('Some content from form.');
\Akismet::reportHam();

ReportSpam() & reportHam() will accept the same parameters. Using these two methods will help make the web a better place for all of us.

#Questions?

If you need help, please let me know and I'll be happy to assist.

统计信息

  • 总下载量: 33
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-26