maritho / badword
package filter badwords filter
0.0.1
2019-12-11 20:51 UTC
This package is auto-updated.
Last update: 2024-09-12 07:58:56 UTC
README
Requirements
Installation
composer require maritho/badword
Configure
so you either you have to add the service provider:
'providers' => [
...,
\Maritho\Badword\BadwordServiceProvider::class,
]
Publish and Migrate
-
php artisan vendor:publish --provider="Maritho\Badword\BadwordServiceProvider"
-
php artisan migrate
-
php artisan db:seed --class="Maritho\Badword\Database\Seeds\BadwordTableSeeder"
Usage
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Maritho\Badword\Badword;
class OrderController extends Controller
{
public function test(Request $request)
{
$data = 'Kamu adalah xxx dan xrated';
// optional extract badword result true or false
return Badword::check($data, true);
}
}