alex-oliveira / ao-recaptcha by alex-oliveira

Using Google ReCaptcha with Laravel 5.1
27
0
2
Package Data
Maintainer Username: alex-oliveira
Maintainer Contact: bsi.alexoliveira@gmail.com (Alex Oliveira)
Package Create Date: 2016-07-29
Package Last Update: 2017-02-02
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-03-23 03:06:00
Package Statistics
Total Downloads: 27
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Ao-ReCaptcha

Using Google ReCaptcha with Laravel 5.1

1) Installation

Run

$ composer require alex-oliveira/ao-recaptcha

Add in your ".env"

RECAPTCHA_SITE_KEY=
RECAPTCHA_SECRET_KEY=

Add in your "config/app.php"

'providers' => [
    /*
     * Vendors Service Providers...
     */
    AoReCaptcha\ServiceProvider::class,
]

Run

$ php artisan vendor:publish

2) Using

Add before </head>

{!! recaptcha()->script() !!}

Add between <form> and </form>

{!! recaptcha()->input() !!}

Add in your controller

try {
    recaptcha()->check(request()->get('g-recaptcha-response'));
} catch (\Exception $e) {
    
}