PHP code example of maatify / cloudflare-turnstile

1. Go to this page and download the library: Download maatify/cloudflare-turnstile library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

maatify / cloudflare-turnstile example snippets



/**
 * Created by Maatify.dev
 * User: Maatify.dev
 * Date: 2024-08-05
 * Time: 11:48 AM
 * https://www.Maatify.dev
 */
 
use Maatify\Turnstile\TurnstileValidation;

e->getResponse();

// ====== get bool of validation 
$result = $turnstile->isSuccess();

// ====== using maatify json on error response with json code with die and if success there is no error
$turnstile->jsonErrors();