PHP code example of nerbiz / crawl-shield

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

    

nerbiz / crawl-shield example snippets


use Illuminate\Foundation\Configuration\Middleware;
use Nerbiz\CrawlShield\Middleware\CrawlShieldMiddleware;

->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        CrawlShieldMiddleware::class,
    ]);
})

use Illuminate\Foundation\Configuration\Middleware;
use Nerbiz\CrawlShield\Middleware\CrawlShieldMiddleware;

->withMiddleware(function (Middleware $middleware) {
    $middleware->alias([
        'crawl-shield' => CrawlShieldMiddleware::class,
    ]);
})

Route::get('/preview', fn () => view('preview'))
    ->middleware('crawl-shield');
bash
php artisan vendor:publish --tag=crawl-shield