承接 kaankilic/wtfilter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kaankilic/wtfilter

Composer 安装命令:

composer require kaankilic/wtfilter

包简介

What The Filter is Profinaity Filter for Laravel

README 文档

README

WTFilter

Build Status Total Downloads Latest Stable Version License

Introduction

WTFilter provides an expressive and fluent way to filter profanities from the content with using it's own engine. WTFilter is the simplest stable profanity filter for Laravel.

License

Laravel WTFilter is open-sourced software licensed under the MIT

Official Documentation

It's simplest way of filtering profanities with the capabilities of Language form. You can set multilangual profanities on each language that you are using on your Laravel project.

Installation

To get started with WTFilter, use Composer to add the package to your project's dependencies:

composer require kaankilic/wtfilter

After installing the WTFilter library, register the Kaankilic\WTFilter\Providers\WTFilterServiceProvider in your config/app.php configuration file:

Kaankilic\WTFilter\Providers\WTFilterServiceProvider::class,

Also, add the WTFilter facade to the aliases array in your app configuration file:

'WTFilter' => Kaankilic\WTFilter\Facades\WTFilter::class

Lastly, Publish the config and language files.

php artisan vendor:publish --provider="Kaankilic\WTFilter\Providers\WTFilterServiceProvider"

This command will generate the configrations on your /config folder, and generate the default language folder on your project.

Basic Usage

<?php

namespace App\Http\Controllers;

use WTFilter;

class CommentsController extends Controller
{
    /**
     * It's filtering your comments that contains profanities.
     */
    public function createComment(Request $request){
    	$contentOfComments = WTFilter::filter($request->get("content_of_comment"));
        
    }
}

Model Trait Usage

You can simply use FilterableTrait on your Model to filter profanities.

<?php 
...
use Kaankilic\WTFilter\Traits\FilterableWords;
class CustomModel extends Model{
	use FilterableWords;

	public function filterable(){
		return [
        	"sources" => ["title"], // trait gonna check this columns
        	"flag" => "has_profanity" // *optionally you can set flag to any column
    	];
    }
...

Contributions

I am the creator and single contributor of the project. So, Feel free to contribute something useful. Please use Github for reporting bugs, and making comments or suggestions

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-09-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固