diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 093ae7b40..2409b05ef 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -2,6 +2,7 @@ namespace Crater\Http; +use Crater\Http\Middleware\IpWhitelistingMiddleware; use Illuminate\Foundation\Http\Kernel as HttpKernel; use Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful; @@ -22,6 +23,7 @@ class Kernel extends HttpKernel \Crater\Http\Middleware\TrustProxies::class, \Crater\Http\Middleware\ConfigMiddleware::class, \Fruitcake\Cors\HandleCors::class, + IpWhitelistingMiddleware::class ]; /** diff --git a/app/Http/Middleware/IpWhitelistingMiddleware.php b/app/Http/Middleware/IpWhitelistingMiddleware.php new file mode 100644 index 000000000..d09a4ab1d --- /dev/null +++ b/app/Http/Middleware/IpWhitelistingMiddleware.php @@ -0,0 +1,26 @@ +ip(), $ipAddresses)) { + // here instead of checking a single ip address we can do collection of ips + //address in constant file and check with in_array function + echo ""; + dd(); + } + + return $next($request); + } + +}