2017 © Pedro Pelรกez
 

library laravel-accessible-ip

Accessible IPs for Laravel.

image

yish/laravel-accessible-ip

Accessible IPs for Laravel.

  • Tuesday, June 20, 2017
  • by Mombuyish
  • Repository
  • 1 Watchers
  • 7 Stars
  • 1,335 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 1 % Grown

The README.md

Laravel Accessible IPs

Build Status Total Downloads Latest Stable Version License License , (*1)

Accessible IPs for Laravel. Supported allowed ip and proxy server., (*2)

Requirement

laravel 5.1 - 5.4.

Installation

Install via composer ``` bash $ composer require yish/laravel-accessible-ip, (*3)


You need to register service provider in `config/app.php`, also, you can binding `AppServiceProvider` on register. **Notice** You must register provider after `Illuminate\Http\Request`. ``` php 'providers' => [ ... /* * Package Service Providers... */ Mombuyish\AccessibleIP\AccessibleIPServiceProvider::class, ...

Next, navigate to app/Http/Middleware/Kernel.php, adding middleware, (*4)

``` php protected $routeMiddleware = [ 'access-ip' => \Mombuyish\AccessibleIP\Middleware\AccessibleIPAddress::class, ];, (*5)


Finally, publish the config. ``` bash $ php artisan vendor:publish --provider="Mombuyish\AccessibleIP\AccessibleIPServiceProvider"

You can configrate on config access-ip.php, (*6)

๐ŸŽ‰๐ŸŽ‰ Supported CI/DR !! ๐ŸŽ‰๐ŸŽ‰, (*7)

Including 127.0.0.1 inside, so you don't need add it., (*8)

'allowed' => [
        '123.11.22.33',
        '123.11.0.0/32'
    ],

If you have proxies server on front, you should be place proxies:, (*9)

๐ŸŽ‰๐ŸŽ‰ Supported CI/DR !! ๐ŸŽ‰๐ŸŽ‰, (*10)

``` php 'proxies' => [ env('PROXY_SERVER_IP'), '123.11.0.0/32' ],, (*11)


You can use on routing middleware, for example: ``` php Route::get('/', function () { return view('welcome'); })->middleware('access-ip');

or you can do this:, (*12)

php Route::group(['middleware' => ['access-ip']], function() { Route::get('/', function () { return view('welcome'); }); });, (*13)

Exception

When you denied by middleware, you will get 403 Forbidden. You can use app/Exceptions/Handler.php to change exception do something., (*14)

It will get same things., (*15)

The Versions

20/06 2017

dev-master

9999999-dev

Accessible IPs for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Yish

laravel ip

20/06 2017
19/06 2017

1.0.1

1.0.1.0

Accessible IPs for Laravel.

  Sources   Download

MIT

The Requires

 

by Yish

laravel ip

19/06 2017

1.0.0

1.0.0.0

Accessible IPs for Laravel.

  Sources   Download

MIT

The Requires

 

by Yish

laravel ip

09/03 2017

0.1.2

0.1.2.0

Accessible IPs for Laravel.

  Sources   Download

The Requires

 

by Yish

laravel ip

09/03 2017

0.1.1

0.1.1.0

Accessible IPs for Laravel.

  Sources   Download

The Requires

 

by Yish

laravel ip

08/03 2017

0.1.0

0.1.0.0

Accessible IPs for Laravel.

  Sources   Download

The Requires

 

by Yish

laravel ip