1. Go to this page and download the library: Download kaankilic/wtfilter 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/ */
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"));
}
}
...
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
];
}
...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.