Download the PHP package noylecorp/laravel-recaptcha without Composer

On this page you can find all versions of the php package noylecorp/laravel-recaptcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-recaptcha

Build Status

Laravel Recaptcha

Laravel 5.1 package for Google reCAPTCHA, providing helper functions for creating reCAPTCHA fields and a service for validating responses.

Note: This package uses reCAPTCHA API version 2.0

Installation

Install Laravel Recaptcha with composer:

composer require noylecorp/laravel-recaptcha

Next, add the service provider to your config/app.php:

'providers' => [
    // ...
    Noylecorp\Recaptcha\RecaptchaServiceProvider::class,
]

Next, publish the package configuration file to your application:

php artisan vendor:publish --provider="Noylecorp\Recaptcha\RecaptchaServiceProvider"

The file recaptcha.php gets copied into your configuration directory. The final installation step is to add your reCAPTCHA site and secret keys to your .env file:

RECAPTCHA_SITE_KEY=your-site-key
RECAPTCHA_SECRET_KEY=your-secret-key

If you don't have reCAPTCHA keys you can signs up for a pair here.

Usage

Creating a reCAPTCHA widget

Easily create reCAPTCHA widgets using the recaptcha() helper function:

{!! recaptcha() !!}

// outputs...

<script src="https://www.google.com/recaptcha/api.js"></script>
<div class="g-recaptcha" data-sitekey="my-site-key"></div>

You can also pass in HTML attributes...

{!! recaptcha(['id' => 'myrecaptcha']) !!}

...or any of reCAPTCHA's available options:

{!! recaptcha(['theme' => 'dark']) !!}

{!! recaptcha(['data-theme' => 'dark']) !!} // same thing

If you need to render the <script> and <div> tags for the reCAPTCHA widget separately, you can use the recaptch_script() and recaptcha_widget() functions:

{!! recaptcha_script() !!}

// ...

{!! recaptcha_widget() !!}

Need to support users without JavaScript? You can also insert a <noscript> fallback:

{!! recaptcha() !!}
{!! recaptcha_noscript() !!}

Or, if you don't want to use any of those helper functions, you can use recaptcha_site_key() to grab the site key for your own custom markup:

<div class="g-recaptcha" data-sitekey="{{ recaptcha_site_key() }}"></div>

Finally, if you have LaravelCollective Html installed, all helper functions can also be accessed through the Form facade:

{!! Form::recaptcha() !!}

Validating reCAPTCHA responses

The simplest way to validate a reCAPTCHA field is by using the added recaptcha validation rule:

// in a controller...
$this->validate($request, [
    'g-recaptcha-response' => 'required|recaptcha'
]);

// in a form request...
public function rules()
{
    return [
        'g-recaptcha-response' => 'required|recaptcha'
    ];
}

Or, you can access the service directly to do manual validation:

if (app('recaptcha')->verify($request->input('g-recaptcha-response'))) {
    // user passed reCAPTCHA
}
else {
    // user failed reCAPTCHA
}

All versions of laravel-recaptcha with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
ext-curl Version *
illuminate/support Version 5.1.*
laravelcollective/html Version 5.1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package noylecorp/laravel-recaptcha contains the following files

Loading the files please wait ....