PHP code example of forutan / fcaptcha

1. Go to this page and download the library: Download forutan/fcaptcha 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/ */

    

forutan / fcaptcha example snippets


Route::post('/comment', function () {
    // Handle comment
})->middleware('fcaptcha.verified:comment');

Route::middleware('fcaptcha.verified:checkout')->group(function () {
    Route::get('/cart', 'CartController@index');
    Route::post('/checkout', 'OrderController@store');
});

    // Where to load CAPTCHA images from (see docs above).
    'image_seed_path' => null,

    // CAPTCHA image resize dimensions (pixels) and quality.
    'default_width' => 200,
    'default_height' => 200,
    'default_quality' => 80,

    // Font used in images.
    'font_path' => base_path('vendor/forutan/fcaptcha/resources/fonts/lightweight.ttf'),

    // Where to redirect after solving CAPTCHA per context.
    'redirect_on_pass' => [
      'default' => '/',
    ],

    // Number of images shown in grid.
    'image_count' => [
      'default' => 12,
    ],

    // How many correct images 
bash
php artisan vendor:publish --tag=fcaptcha-config
bash
php artisan fcaptcha:prepare-images
bash
php artisan fcaptcha:prepare-images
bash
php artisan vendor:publish --tag=fcaptcha-seeds
bash
php artisan fcaptcha:prepare-images --from=storage/app/private/fcaptcha_seeder
bash
php artisan vendor:publish --tag=fcaptcha-views