Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
no-captcha
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
CENTER-TBI
no-captcha
Commits
71e76e70
Commit
71e76e70
authored
Dec 04, 2014
by
Nguyễn Văn Ánh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
59ec3718
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
3 deletions
+98
-3
README.md
README.md
+98
-3
No files found.
README.md
View file @
71e76e70
No CAPTCHA reCAPTCHA
No CAPTCHA reCAPTCHA
[![Build Status](https://travis-ci.org/anhskohbo/no-captcha.svg?branch=master&style=flat-square)](https://travis-ci.org/anhskohbo/no-captcha)
==========
==========
[
![Build Status
](
https://travis-ci.org/anhskohbo/no-captcha.svg?branch=master&style=flat-square
)
](https://travis-ci.org/anhskohbo/no-captcha
)
![
recaptcha_anchor 2x
](
https://cloud.githubusercontent.com/assets/1529454/5291635/1c426412-7b88-11e4-8d16-46161a081ece.gif
)
[
Updating...
]
## Installation
Add the following line to the
`require`
section of
`composer.json`
:
```
json
{
"require"
:
{
"anhskohbo/no-captcha"
:
"dev-master"
}
}
```
Run
`composer update`
.
## Laravel
### Setup
Add ServiceProvider to the providers array in
`app/config/app.php`
.
```
'Anhskohbo\NoCaptcha\NoCaptchaServiceProvider',
```
### Configuration
Run
`php artisan config:publish anhskohbo/no-captcha`
(
`publish:config`
if you use Laravel 5).
Fill secret and sitekey config in
`app/config/packages/anhskohbo/no-captcha/config.php`
file:
```
php
<?php
return
array
(
'secret'
=>
''
,
'sitekey'
=>
''
,
);
```
### Usage
Display reCAPTCHA:
```
php
<?php
echo
Form
::
open
()
?>
<?php
echo
Form
::
captcha
()
?>
//
<?php
app
(
'captcha'
)
->
display
();
// for Laravel 5 ?>
<?
php
echo
Form
::
submit
()
?>
<?php
echo
Form
::
close
()
?>
```
Validate, add
`'g-recaptcha-response' => 'required|captcha'`
to rules array.
```
php
$validate
=
Validator
::
make
(
Input
::
all
(),
[
'g-recaptcha-response'
=>
'required|captcha'
]);
```
## Without Laravel
Checkout example below:
```
<?php
require_once
"vendor/autoload.php"
;
$secret
=
''
;
$sitekey
=
''
;
$captcha
=
new
\Anhskohbo\NoCaptcha\NoCaptcha
(
$secret
,
$sitekey
);
if
(
!
empty
(
$_POST
))
{
var_dump
(
$captcha
->
verifyResponse
(
$_POST
[
'g-recaptcha-response'
]));
exit
();
}
?>
<form
action=
"?"
method=
"POST"
>
<?php
echo
$captcha
->
display
();
?>
<button
type=
"submit"
>
Submit
</submit>
</form>
```
## Contribute
https://github.com/anhskohbo/no-captcha/pulls
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment