PHP code example of askedio / laravel5-profanity-filter
1. Go to this page and download the library: Download askedio/laravel5-profanity-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/ */
askedio / laravel5-profanity-filter example snippets
$string = app('profanityFilter')->filter('something with a bad word');
$string = app('profanityFilter')->replaceWith('#')->replaceFullWords(false)->filter('something with a bad word'));
use Askedio\Laravel5ProfanityFilter\ProfanityFilter;
$config = []; // Data from `resources/config/profanity.php`
$badWordsArray = []; // Data from `resources/lang/[lang]/profanity.php`
$profanityFilter = new ProfanityFilter($config, $badWordsArray);
$string = $profanityFilter->filter('something with a bad word');
php artisan vendor:publish
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.