Blaspsoft / blasp

Blasp is a profanity filter package for Laravel
MIT License
199 stars 11 forks source link

Add support for French language and improve validation rules #3

Closed charleskoko closed 1 month ago

charleskoko commented 1 month ago

This pull request introduces the following key changes to the Blasp package:

Default Language Set to English: The package now defaults to English (en) for profanity detection.

Support for French: The package has been extended to support French language. Users can specify the desired language by passing a language code ('en', 'fr'.) as an argument.

Laravel Validation Rule Update: The custom Laravel validation rule blasp_check now supports language-specific validation. Users can validate French text input for profanities by specifying the blasp_check:fr rule.

$sentence = 'Ce projet est totalement merdique';
$blasp = Blasp::check($sentence, 'fr');

$validated = $request->validate([
    'sentence' => ['blasp_check:fr'],
])

This update makes the package more versatile for multi-language applications, starting with French support.

deemonic commented 1 month ago

Hi @charleskoko

Thank you for the PR at first glance it looks great!

I will get it reviewed over the next few days

Many Thanks

Mike