Download the PHP package arandilopez/laravel-profane without Composer
On this page you can find all versions of the php package arandilopez/laravel-profane. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arandilopez/laravel-profane
More information about arandilopez/laravel-profane
Files in arandilopez/laravel-profane
Package laravel-profane
Short Description Laravel Profanity Valitador
License MIT
Informations about the package laravel-profane
Laravel Profanity Validator
I made this package to perform a validation for swearwords using Laravel validation service.
Installation
Install via composer
Configuration
Add the ProfaneServiceProvider
class in your config/app.php
file.
Publish vendor lang files if you need to replace by your own.
Usage
This package register a custom validator. You can use in your controller's validate
function.
The validator will load the default locale in your config/app.php
file configuration which by is en
. If your locale is not supported, please post an issue for this project
If you want to use others dictionaries you can pass them as parameters in the validator.
You can also send as parameter a path of a file which is a dictionary in order to replace the default dictionary or add a new non supported locale.
Strict validation
Now you can strictly validate the exact profane word in the content.
This fixes known issues when you get a error in validation for words like class
or analysis
, as they include ass
and anal
respectively, but fails the validation for content like sucker69
.
Getting Help
If you're stuck getting something to work, or need to report a bug, please post an issue in the Github Issues for this project.
Contributing
If you're interesting in contributing code to this project, clone it by running:
Please read the CONTRIBUTING file.
Pull requests are welcome, but please make sure you provide unit tests to cover your changes. You can help to add and support more locales!
Thanks to @dorianneto for his contributions.
Supported Locales
- English ( provided by @arandilopez )
- Spanish ( provided by @arandilopez and @xDidier901)
- Italian ( provided by @aletundo )
- Brazilian Portuguese ( provided by @ianrodriguesbr and @LeonardoTeixeira)
- Traditional Chinese ( provided by @Nationalcat )
- Slovak ( provided by @kotass )
- Dutch (Netherlands) ( provided by @Cannonb4ll and @WouterVanmulken)
- Greek ( provided by @siokas )
- Malayalam ( provided by @abinodh )
- Russian ( provided by @alex2sat )
- Serbian ( provided by @Djuki )
- Filipino ( provided by @credocleo )
- Romanian ( provided by @rchioreanu )
- Indonesian ( provided by @rizasaputra )
License
This project is open-sourced software licensed under the MIT license.