{"id":27702410,"url":"https://github.com/arandilopez/laravel-profane","last_synced_at":"2025-04-25T20:54:13.078Z","repository":{"id":9883639,"uuid":"63648834","full_name":"arandilopez/laravel-profane","owner":"arandilopez","description":"Profanity Validator for Laravel","archived":false,"fork":false,"pushed_at":"2024-02-15T18:21:41.000Z","size":126,"stargazers_count":87,"open_issues_count":11,"forks_count":33,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-19T22:49:49.163Z","etag":null,"topics":["composer","dictionaries","hacktoberfest","laravel","laravel-package","laravel-profane","php","profanity-validator","swearword","validation"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arandilopez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-19T01:21:35.000Z","updated_at":"2024-09-05T21:15:25.000Z","dependencies_parsed_at":"2024-06-19T01:40:59.658Z","dependency_job_id":"108e7a89-9028-4f52-a6cd-fc18cda1e31a","html_url":"https://github.com/arandilopez/laravel-profane","commit_stats":{"total_commits":113,"total_committers":27,"mean_commits":4.185185185185185,"dds":0.4247787610619469,"last_synced_commit":"a49390e437463d5f9ec1a943c8a60e9ca7de4466"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arandilopez%2Flaravel-profane","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arandilopez%2Flaravel-profane/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arandilopez%2Flaravel-profane/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arandilopez%2Flaravel-profane/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arandilopez","download_url":"https://codeload.github.com/arandilopez/laravel-profane/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250216164,"owners_count":21393913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","dictionaries","hacktoberfest","laravel","laravel-package","laravel-profane","php","profanity-validator","swearword","validation"],"created_at":"2025-04-25T20:54:11.671Z","updated_at":"2025-04-25T20:54:12.569Z","avatar_url":"https://github.com/arandilopez.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Profanity Validator\n\n[![Latest Stable Version](https://poser.pugx.org/arandilopez/laravel-profane/v/stable)](https://packagist.org/packages/arandilopez/laravel-profane)\n[![Total Downloads](https://poser.pugx.org/arandilopez/laravel-profane/downloads)](https://packagist.org/packages/arandilopez/laravel-profane)\n[![License](https://poser.pugx.org/arandilopez/laravel-profane/license)](https://packagist.org/packages/arandilopez/laravel-profane)\n[![Daily Downloads](https://poser.pugx.org/arandilopez/laravel-profane/d/daily)](https://packagist.org/packages/arandilopez/laravel-profane)\n[![composer.lock](https://poser.pugx.org/arandilopez/laravel-profane/composerlock)](https://packagist.org/packages/arandilopez/laravel-profane)\n![](https://travis-ci.org/arandilopez/laravel-profane.svg?branch=master)\n[![StyleCI](https://styleci.io/repos/63648834/shield?branch=master)](https://styleci.io/repos/63648834)\n\nI made this package to perform a validation for swearwords using Laravel validation service.\n\n## Installation\n\nInstall via composer\n\n```shell\ncomposer require arandilopez/laravel-profane\n```\n\n## Configuration\n\nAdd the `ProfaneServiceProvider` class in your `config/app.php` file.\n\n```php\n\u003c?php\nreturn [\n    // ...\n\n    'providers' =\u003e [\n        // ...\n        LaravelProfane\\ProfaneServiceProvider::class,\n    ];\n\n    // ...\n];\n```\n\nPublish vendor lang files if you need to replace by your own.\n\n```shell\nphp artisan vendor:publish\n```\n\n## Usage\n\nThis package register a custom validator. You can use in your controller's `validate` function.\n\n```php\n\u003c?php\n// ...\nclass MyController extends Controller\n{\n    public function store(Request $request)\n    {\n        $this-\u003evalidate($request, [\n            'username' =\u003e 'required|profane'\n        ]);\n\n        // ...\n    }\n}\n```\n\nThe 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](https://github.com/arandilopez/laravel-profane/issues)**\n\nIf you want to use others dictionaries you can pass them as parameters in the validator.\n\n```php\n\u003c?php\n// ...\nclass MyController extends Controller\n{\n    public function store(Request $request)\n    {\n        $this-\u003evalidate($request, [\n            'username' =\u003e 'required|profane:es,en'\n        ]);\n\n        // ...\n    }\n}\n```\n\nYou 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**.\n\n```php\n\u003c?php\n// ...\nclass MyController extends Controller\n{\n    public function store(Request $request)\n    {\n        $this-\u003evalidate($request, [\n            'username' =\u003e 'required|profane:es,en,'.resource_path('lang/fr/dict.php')\n        ]);\n\n        // ...\n    }\n}\n```\n\n#### Strict validation\n\nNow you can strictly validate the exact profane word in the content.\n\n```php\n\u003c?php\n// ...\nclass MyController extends Controller\n{\n    public function store(Request $request)\n    {\n        $this-\u003evalidate($request, [\n            'username' =\u003e 'required|strictly_profane:es,en'\n        ]);\n\n        // ...\n    }\n}\n```\n\nThis 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`.\n\n## Getting Help\n\nIf you're stuck getting something to work, or need to report a bug, please [post an issue in the Github Issues for this project](https://github.com/arandilopez/laravel-profane/issues).\n\n## Contributing\n\nIf you're interesting in contributing code to this project, clone it by running:\n\n```shell\ngit clone git@github.com:arandilopez/laravel-profane.git\n```\n\nPlease read the [CONTRIBUTING](CONTRIBUTING.md) file.\n\nPull requests are welcome, but please make sure you provide unit tests to cover your changes. **You can help to add and support more locales!**\n\n_Thanks to [@dorianneto](https://github.com/dorianneto) for his contributions._\n\n### Supported Locales\n\n- English ( provided by [@arandilopez](https://github.com/arandilopez) )\n- Spanish ( provided by [@arandilopez](https://github.com/arandilopez) and [@xDidier901](https://github.com/xDidier901))\n- Italian ( provided by [@aletundo](https://github.com/aletundo) )\n- Brazilian Portuguese ( provided by [@ianrodriguesbr](https://github.com/ianrodriguesbr)  and [@LeonardoTeixeira](https://github.com/LeonardoTeixeira))\n- Traditional Chinese ( provided by [@Nationalcat](https://github.com/Nationalcat) )\n- Slovak ( provided by [@kotass](https://github.com/kotass) )\n- Dutch (Netherlands) ( provided by [@Cannonb4ll](https://github.com/Cannonb4ll) and [@WouterVanmulken](https://github.com/WouterVanmulken))\n- Greek ( provided by [@siokas](https://github.com/siokas) )\n- Malayalam ( provided by [@abinodh](https://github.com/abinodh) )\n- Russian ( provided by [@alex2sat](https://github.com/alex2sat) )\n- Serbian ( provided by [@Djuki](https://github.com/Djuki) )\n- Filipino ( provided by [@credocleo](https://github.com/credocleo) )\n- Romanian ( provided by [@rchioreanu](https://github.com/rchioreanu) )\n- Indonesian ( provided by [@rizasaputra](https://github.com/rizasaputra) )\n\n## License\n\nThis project is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farandilopez%2Flaravel-profane","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farandilopez%2Flaravel-profane","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farandilopez%2Flaravel-profane/lists"}