1. Go to this page and download the library: Download consoletvs/profanity 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/ */
$words = 'My bad word bitch';
$clean_words = \ConsoleTVs\Profanity\Builder::blocker($words)->filter();
// My bad word *****
// Filter words only by English and German bad words.
$clean_words = \ConsoleTVs\Profanity\Builder::blocker($words, languages: ['en', 'de'])->filter();
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use ConsoleTVs\Profanity\Facades\Profanity;
// or using the alias:
// use Profanity;
class HomeController extends Controller
{
/**
* Simple test function.
*
* @return string
*/
public function test()
{
$words = 'My bad word bitch';
return Profanity::blocker($words)->filter();
// My bad word *****
}
}
config/app.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.