{"id":13684574,"url":"https://github.com/ctlabvn/Recaptcha","last_synced_at":"2025-04-30T21:31:03.004Z","repository":{"id":25677302,"uuid":"47564984","full_name":"ctlabvn/Recaptcha","owner":"ctlabvn","description":"CakePHP: Easy to integrate Google Recaptcha v2 to your project.","archived":false,"fork":false,"pushed_at":"2023-10-18T18:26:16.000Z","size":99,"stargazers_count":21,"open_issues_count":2,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-02T21:03:42.872Z","etag":null,"topics":["cakephp","composer","recaptcha"],"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/ctlabvn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2015-12-07T16:37:26.000Z","updated_at":"2024-08-05T06:22:03.000Z","dependencies_parsed_at":"2024-01-22T07:48:04.447Z","dependency_job_id":"a6c2e4f7-068e-4bd0-8190-3b7c1eb08d9e","html_url":"https://github.com/ctlabvn/Recaptcha","commit_stats":{"total_commits":82,"total_committers":10,"mean_commits":8.2,"dds":0.6585365853658536,"last_synced_commit":"60811d7c6a47a2b7f72a884b24023e4ec1d42e46"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctlabvn%2FRecaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctlabvn%2FRecaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctlabvn%2FRecaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctlabvn%2FRecaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctlabvn","download_url":"https://codeload.github.com/ctlabvn/Recaptcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224224797,"owners_count":17276428,"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":["cakephp","composer","recaptcha"],"created_at":"2024-08-02T14:00:35.069Z","updated_at":"2025-04-30T21:31:02.979Z","avatar_url":"https://github.com/ctlabvn.png","language":"PHP","readme":"[![Build Status](https://img.shields.io/github/actions/workflow/status/ctlabvn/Recaptcha/ci.yml?branch=master)](https://github.com/ctlabvn/Recaptcha/actions/workflows/ci.yml?query=branch%3Amaster)\n[![Latest Stable Version](https://img.shields.io/packagist/v/crabstudio/recaptcha)](https://packagist.org/packages/crabstudio/recaptcha)\n[![Total Downloads](https://img.shields.io/packagist/dt/crabstudio/recaptcha)](https://packagist.org/packages/crabstudio/recaptcha)\n[![License](https://img.shields.io/github/license/ctlabvn/Recaptcha)](https://github.com/ctlabvn/Recaptcha/blob/master/LICENSE)\n\n# Integrate Google Recaptcha v2 to your CakePHP project\n\n## Installation\n\nYou can install this plugin into your CakePHP application using [composer](http://getcomposer.org).\n\nThe recommended way to install composer packages is:\n\n```bash\ncomposer require crabstudio/recaptcha\n```\n\n## Load plugin\n\nFrom command line:\n\n```bash\nbin/cake plugin load Recaptcha\n```\n\n## Load Component and Configure\n\nOverride default configure from loadComponent:\n\n```php\n$this-\u003eloadComponent('Recaptcha.Recaptcha', [\n    'enable' =\u003e true,     // true/false\n    'sitekey' =\u003e 'your_site_key', //if you don't have, get one: https://www.google.com/recaptcha/intro/index.html\n    'secret' =\u003e 'your_secret',\n    'type' =\u003e 'image',  // image/audio\n    'theme' =\u003e 'light', // light/dark\n    'lang' =\u003e 'en', // default 'en'\n    'size' =\u003e 'normal'  // normal/compact\n    'callback' =\u003e null, // `callback` data attribute for the recaptcha div, default `null`\n    'scriptBlock' =\u003e true // Value for `block` option for HtmlHelper::script() call\n]);\n```\n\nOverride default config from app config file:\n\n```php\n// file: config/app.php\n\n    /**\n     * Recaptcha configuration.\n     */\n    'Recaptcha' =\u003e [\n        'sitekey' =\u003e 'your_site_key',\n        'secret' =\u003e 'your_secret',\n        'type' =\u003e 'image',\n        'theme' =\u003e 'light',\n        'lang' =\u003e 'es',\n        'size' =\u003e 'normal'\n    ]\n```\n\nOverride default configure from recaptcha config file:\n\n```php\n// file: config/recaptcha.php\n\nreturn [\n    /**\n     * Recaptcha configuration.\n     *\n     */\n    'Recaptcha' =\u003e [\n        'enable' =\u003e true,\n        'sitekey' =\u003e 'your_site_key',\n        'secret' =\u003e 'your_secret',\n        'type' =\u003e 'image',\n        'theme' =\u003e 'light',\n        'lang' =\u003e 'es',\n        'size' =\u003e 'normal'\n    ]\n];\n```\n\nLoad recaptcha config file:\n\n```php\n// file: config/bootstrap.php\n\n    Configure::load('recaptcha', 'default', true);\n```\n\nConfig preference:\n1. loadComponent config options\n2. recaptcha config file\n3. app config file\n\n## Usage\n\nDisplay recaptcha in your template:\n\n```php\n    \u003c?= $this-\u003eForm-\u003ecreate() ?\u003e\n    \u003c?= $this-\u003eForm-\u003econtrol('email') ?\u003e\n    // Display recaptcha box in your template, if configure has enable = false, nothing will be displayed\n    \u003c?= $this-\u003eRecaptcha-\u003edisplay() ?\u003e\n    \u003c?= $this-\u003eForm-\u003ebutton() ?\u003e\n    \u003c?= $this-\u003eForm-\u003eend() ?\u003e\n```\n\nVerify in your controller function\n\n```php\n    public function forgotPassword()\n    {\n        if ($this-\u003erequest-\u003eis('post')) {\n            if ($this-\u003eRecaptcha-\u003everify()) { // if configure enable = false, it will always return true\n                //do something here\n            }\n            $this-\u003eFlash-\u003eerror(__('Please pass Google Recaptcha first'));\n        }\n    }\n```\n\nDone.\n","funding_links":[],"categories":["Security"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctlabvn%2FRecaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctlabvn%2FRecaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctlabvn%2FRecaptcha/lists"}