Skip to content

Commit

Permalink
Merge pull request #3 from charleskoko/add-language-support
Browse files Browse the repository at this point in the history
Add support for French language and improve validation rules
  • Loading branch information
deemonic authored Oct 25, 2024
2 parents 9d3fbe4 + 66147f6 commit d8dc4d8
Show file tree
Hide file tree
Showing 14 changed files with 1,947 additions and 1,442 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ use Blaspsoft\Blasp\Facades\Blasp;
$sentence = 'This is a fucking shit sentence';
$check = Blasp::check($sentence);
```
you can also change the default language to french
```php
use Blaspsoft\Blasp\Facades\Blasp;

$sentence = 'Cette phrase est merdique';
$check = Blasp::check($sentence, 'fr');
```
The returned object will contain the following properties:

- **sourceString**: The original string you passed.
Expand Down Expand Up @@ -79,7 +85,12 @@ $validated = $request->validate([

// If the sentence contains profanities, validation will fail.
```

or for french
```php
$validated = $request->validate([
'sentence' => ['blasp_check:fr'],
]);
```
### Configuration

Blasp uses a configuration file (`config/blasp.php`) to manage the list of profanities, separators, and substitutions. You can publish the configuration file using the following Artisan command:
Expand Down
Loading

0 comments on commit d8dc4d8

Please sign in to comment.