PHP code example of cresjie / ip-blocker

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

    

cresjie / ip-blocker example snippets


 'providers' => array(
	...
	Cresjie\IpBlocker\IpBlockerServiceProvider::class,
)

// app/Exceptions/Handler.php

public function render($request, Exception $e)
{
	switch($e){
		case ($e instanceof \Cresjie\IpBlocker\IpBlockerException):
			return response()->view('view-path');
			break;
		default:
			return parent::render($request, $e);

	}

    return parent::render($request, $e);
}


$ php artisan vendor:publish

 [L5 root]/config/cresjie/block-ip.php