Sc3n3 / laravel-ip-access

IP restriction middleware for Laravel 5
6 stars 1 forks source link

Setting source IP when Unit Testing #2

Open bellwood opened 6 years ago

bellwood commented 6 years ago

When unit testing a Laravel project, do you have a solution for setting the source IP so that middleware can remain enabled?

bellwood commented 6 years ago

Adding the following to the middleware resolves this issue:

        if (App::environment('testing')) {
            return $next($request);
        }