PHP code example of craigpotter / laravel-ie-honeypot

1. Go to this page and download the library: Download craigpotter/laravel-ie-honeypot 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/ */

    

craigpotter / laravel-ie-honeypot example snippets


return [
    /**
     * This switch determines if the honeypot protection should be activated.
     */
    'enabled' => env('IE_HONEYPOT_ENABLED', true),

    /**
     * This switch determines the URL that IE users will get redirect to.
     */
    'redirect_url' => env('IE_HONEYPOT_REDIRECT_URL', '/ie-trap'),

    /**
     * This switch determines if the bypass functionality is enabled.
     * This will allow use of the @ieBypass directive and allow IE users to access your
     * site by adding ?ie-bypass=true to a url
     */
    'bypass_enabled' => env('IE_HONEYPOT_BYPASS_ENABLED', true),

];

use CraigPotter\LaravelIEHoneypot\CaptureIE;

Route::get('/', [YourController::class])->middleware(CaptureIE::class);

// OR

Route::middleware(CaptureIE::class)->group(function() {
    // Routes
});

// app\Http\Kernal.php 

protected $middleware = [
   // ...
   \CraigPotter\LaravelIEHoneypot\CaptureIE::class,
];

bash
php artisan vendor:publish --provider="CraigPotter\LaravelIEHoneypot\LaravelIEHoneypotServiceProvider" --tag="ie-honeypot-config"