{"id":16466758,"url":"https://github.com/torralbodavid/simple-recaptcha-v3","last_synced_at":"2025-03-21T06:32:03.976Z","repository":{"id":46582460,"uuid":"263758912","full_name":"torralbodavid/simple-recaptcha-v3","owner":"torralbodavid","description":"🤖 This repository contains simple reCAPTCHA v3 integration for your Laravel application.","archived":false,"fork":false,"pushed_at":"2022-03-05T11:40:09.000Z","size":133,"stargazers_count":23,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T22:08:40.424Z","etag":null,"topics":["captcha","hacktoberfest","laravel-application","laravel-package","laravel-rule","recaptcha","recaptcha-badge","recaptcha-v3","recaptcha-v3-laravel","recaptcha-verification","snippets"],"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/torralbodavid.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-13T22:39:46.000Z","updated_at":"2023-11-23T19:48:28.000Z","dependencies_parsed_at":"2022-08-24T10:40:52.899Z","dependency_job_id":null,"html_url":"https://github.com/torralbodavid/simple-recaptcha-v3","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torralbodavid%2Fsimple-recaptcha-v3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torralbodavid%2Fsimple-recaptcha-v3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torralbodavid%2Fsimple-recaptcha-v3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torralbodavid%2Fsimple-recaptcha-v3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/torralbodavid","download_url":"https://codeload.github.com/torralbodavid/simple-recaptcha-v3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244751371,"owners_count":20504239,"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":["captcha","hacktoberfest","laravel-application","laravel-package","laravel-rule","recaptcha","recaptcha-badge","recaptcha-v3","recaptcha-v3-laravel","recaptcha-verification","snippets"],"created_at":"2024-10-11T11:44:41.889Z","updated_at":"2025-03-21T06:32:03.709Z","avatar_url":"https://github.com/torralbodavid.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple reCAPTCHA v3 integration\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/torralbodavid/simple-recaptcha-v3.svg?style=flat-square)](https://packagist.org/packages/torralbodavid/simple-recaptcha-v3)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/torralbodavid/simple-recaptcha-v3/run-tests?label=tests)\n[![Quality Score](https://img.shields.io/scrutinizer/g/torralbodavid/simple-recaptcha-v3.svg?style=flat-square)](https://scrutinizer-ci.com/g/torralbodavid/simple-recaptcha-v3)\n[![Total Downloads](https://img.shields.io/packagist/dt/torralbodavid/simple-recaptcha-v3.svg?style=flat-square)](https://packagist.org/packages/torralbodavid/simple-recaptcha-v3)\n\nThis repository contains simple reCAPTCHA v3 integration for your Laravel application.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require torralbodavid/simple-recaptcha-v3\n```\n\n## Usage\n\n1. Set the following variables in your .env\n\nOverride xxxxx with your reCaptcha v3 keys. Get yours [here](https://www.google.com/recaptcha/admin)\n\n```\nCAPTCHA_SITE_KEY=xxxxx\nCAPTCHA_SECRET_KEY=xxxxx\n```\n\nOptionally, you can publish the config file of the package. You will be able to customize advanced settings, such as:\n\n* Disabling reCaptcha v3\n* Minimum score you should get in order to validate your form\n* Hostname validation\n* Hide reCaptcha badge\n* Prefer navigator language on reCaptcha badge\n\n```bash\nphp artisan vendor:publish --provider=\"Torralbodavid\\SimpleRecaptchaV3\\SimpleRecaptchaV3ServiceProvider\" --tag=config\n```\n\n2. To get started, you must include at the very bottom of your head tag from the pages you want to protect with reCaptcha, the `@captcha_init` blade directive. This will start loading Google reCAPTCHA API.\n\n```html\n    \u003chtml\u003e\n        \u003chead\u003e\n            ...\n            \n            @captcha_init\n        \u003c/head\u003e\n    \u003c/html\u003e\n```\n\n3. Include below your form initialization tag, the `@captcha('xxxx')` blade directive. Replace xxxx with your desired [action](https://developers.google.com/recaptcha/docs/v3#actions).\n\n```html\n    \u003cform method=\"...\" action=\"...\"\u003e\n        @captcha('login')\n        ...\n    \u003c/form\u003e\n```\n\n4. To sum up, add the following rule on your form validation:\n\n```php\n    'recaptcha_response' =\u003e new Captcha\n```\n\n```php\n    use Torralbodavid\\SimpleRecaptchaV3\\Rules\\Captcha;\n    \n    ...\n    \n    $request-\u003evalidate([\n        ...\n        'recaptcha_response' =\u003e new Captcha,\n    ]);\n```\n\n### Customize error messages\n\nYou can customize reCaptcha v3 error messages by publishing the translations on your project.\n\n```bash\nphp artisan vendor:publish --provider=\"Torralbodavid\\SimpleRecaptchaV3\\SimpleRecaptchaV3ServiceProvider\" --tag=lang\n```\n\n### Customize snippets\n\nYou can customize @captcha and @captcha_init snippets by publishing the views on your project\n\n```bash\nphp artisan vendor:publish --provider=\"Torralbodavid\\SimpleRecaptchaV3\\SimpleRecaptchaV3ServiceProvider\" --tag=views\n```\n\n### Disable reCaptcha v3 integration in tests\n\nYou can easily disable reCaptcha v3 integration in your tests by adding the following configuration on them\n\n```php\nconfig()-\u003eset('simple-recaptcha-v3.active', false);\n```\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email davidtorralboperez@gmail.com instead of using the issue tracker.\n\n## Credits\n\n- [David Torralbo Pérez](https://github.com/torralbodavid)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\nHave fun!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorralbodavid%2Fsimple-recaptcha-v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorralbodavid%2Fsimple-recaptcha-v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorralbodavid%2Fsimple-recaptcha-v3/lists"}