2017 © Pedro Peláez
 

laravel-package ip-blocker

Laravel IP address blocker

image

cresjie/ip-blocker

Laravel IP address blocker

  • Wednesday, January 18, 2017
  • by cresjie
  • Repository
  • 1 Watchers
  • 1 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Laravel IP Blocker

Simple and easy to configure laravel ip blocker, (*1)


Installation via Composer

Add this to your composer.json file, in the require object:, (*2)

 "cresjie/ip-blocker": "v1.0.0.1"

After that, run composer install to install the package., (*3)

Add the service provider to app/config/app.php for laravel 4 and config/app.php for laravel 5, within the providers array., (*4)

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

Configuration

Publish the default config file to your application so you can make modifications., (*5)

$ php artisan config:publish cresjie/ip-blocker

Add your block IP's to the configuration file:, (*6)

 app/config/packages/cresjie/ip-blocker/config.php

Handling/Custom View

if the IP was blocked, it would throw Cresjie\IpBlocker\IpBlockerException. you could create a view by just handling the exception like this:, (*7)

laravel 4

App::error(function(Exception $e){

    switch($e){
        case ($e instanceof \Cresjie\IpBlocker\IpBlockerException):
            return View::make('view-path');
            break;
    }
});

laravel 5

// app/Exceptions/Handler.php

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

    }

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

The Versions

18/01 2017

v1.2.x-dev

1.2.9999999.9999999-dev https://github.com/cresjie/ip-blocker

Laravel IP address blocker

  Sources   Download

MIT

The Requires

 

by Cres Jie Labasano

laravel ip firewall blocker cresjie

18/01 2017

v1.2.0.0

1.2.0.0 https://github.com/cresjie/ip-blocker

Laravel IP address blocker

  Sources   Download

MIT

The Requires

 

by Cres Jie Labasano

laravel ip firewall blocker cresjie

17/05 2016

dev-master

9999999-dev https://github.com/cresjie/ip-blocker

Laravel IP address blocker

  Sources   Download

MIT

The Requires

 

by Cres Jie Labasano

laravel ip firewall blocker cresjie

17/05 2016

v1.0.0.1

1.0.0.1 https://github.com/cresjie/ip-blocker

Laravel IP address blocker

  Sources   Download

MIT

The Requires

 

by Cres Jie Labasano

laravel ip firewall blocker cresjie

02/02 2016

v1.0.0.0

1.0.0.0 https://github.com/cresjie/ip-blocker

Laravel IP address blocker

  Sources   Download

MIT

The Requires

 

by Cres Jie Labasano

laravel ip firewall blocker cresjie