Created
April 28, 2018 14:00
-
-
Save cesargb/a36e40c9bd41d547e08ce38f86a960e8 to your computer and use it in GitHub Desktop.
Laravel LiteFirewall
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Symfony\Component\HttpFoundation\IpUtils; | |
class Firewall | |
{ | |
public function handle($request, Closure $next, $netwoks) | |
{ | |
$netwoks = is_array($netwoks) | |
? $netwoks | |
: explode('|', $netwoks); | |
if (IpUtils::checkIp($request->ip(), $netwoks)) { | |
return $next($request); | |
} else { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment