PHP code example of jobmetric / laravel-ban-ips

1. Go to this page and download the library: Download jobmetric/laravel-ban-ips 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/ */

    

jobmetric / laravel-ban-ips example snippets


use JobMetric\BanIp\Facades\BanIp;

BanIp::store([
    'ip' => 'sample ip',
    'type' => 'hacker',
    'reason' => 'This is a sample reason',
    'banned_at' => now(),
    'expire_at' => now()->addDays(1),
]);

use JobMetric\BanIp\Facades\BanIp;

BanIp::update([
    'type' => 'hacker',
    'reason' => 'This is a sample reason',
    'banned_at' => now(),
    'expire_at' => now()->addDays(1),
]);

use JobMetric\BanIp\Facades\BanIp;

BanIp::delete(/* ban ip id */);

use JobMetric\BanIp\Facades\BanIp;

BanIp::deleteExpired();
bash
php artisan migrate