Download the PHP package mrlks/cloudflare-turnstile-laravel without Composer

On this page you can find all versions of the php package mrlks/cloudflare-turnstile-laravel. 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 cloudflare-turnstile-laravel

Laravel Cloudflare Turnstile

[![Latest Version on Packagist](https://img.shields.io/packagist/v/mrlks/cloudflare-turnstile-laravel.svg)](https://packagist.org/packages/mrlks/cloudflare-turnstile-laravel) [![Total Downloads](https://img.shields.io/packagist/dt/mrlks/cloudflare-turnstile-laravel.svg)](https://packagist.org/packages/mrlks/cloudflare-turnstile-laravel) [![License](https://img.shields.io/packagist/l/mrlks/cloudflare-turnstile-laravel.svg)](LICENSE.md)

A Laravel package that provides an elegant way to integrate Cloudflare Turnstile CAPTCHA protection into your Laravel applications. Turnstile is Cloudflare's privacy-first CAPTCHA alternative that helps protect your forms from spam and abuse.

Features

Requirements

Installation

You can install the package via composer:

Configuration

  1. Publish the configuration file:

  2. Add your Cloudflare Turnstile credentials to your .env file:

TURNSTILE_SITE_KEY=your-site-key TURNSTILE_SECRET_KEY=your-secret-key

Usage

Basic Form Integration

  1. Add the Turnstile widget to your form:

{!! Turnstile::renderWidget() !!}

  1. Validate the Turnstile response in your controller:

use MrLks\CloudflareTurnstileLaravel\Rules\TurnstileRule; public function store(Request $request) { $request->validate([ 'cf-turnstile-response' => ['required', new TurnstileRule], ]); // Your logic here }

Using Middleware

Protect your routes using the Turnstile middleware:

// In your routes file Route::post('/protected-route', function () { // Your protected route logic })->middleware('turnstile'); // Or in your controller public function construct() { $this->middleware('turnstile')->only(['store', 'update']); }

Customizing the Widget

You can customize the widget appearance:

{!! Turnstile::renderWidget([ 'data-theme' => 'dark', 'data-size' => 'compact', 'data-action' => 'login', 'data-language' => 'en' ]) !!}

Available options:

Configuration Options

The config/turnstile.php file allows you to configure:

return [ // Your Cloudflare Turnstile keys 'site_key' => env('TURNSTILE_SITE_KEY', ''), 'secret_key' => env('TURNSTILE_SECRET_KEY', ''), // Verification endpoint 'verify_url' => env('TURNSTILE_VERIFY_URL', 'https://challenges.cloudflare.com/turnstile/v0/siteverify'), // Default widget settings 'theme' => 'light', 'size' => 'normal', ];

Events

The package dispatches the following events:

Testing

composer test

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Support

For support, please use the issue tracker.

Contributing

Please see CONTRIBUTING.md for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

cloudflare-turnstile-laravel

Laravel integration for Cloudflare Turnstile CAPTCHA

1066a7ad2c02e4c3d3d86e8c7d6fba8efae75106

cloudflare-turnstile-laravel

bc520bb64e4deb9561a07f56826d3bd9a264f47c


All versions of cloudflare-turnstile-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0
guzzlehttp/guzzle Version ^7.0
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 mrlks/cloudflare-turnstile-laravel contains the following files

Loading the files please wait ....