src/Webpage/Middleware/EnvironmentAuth.php
public function handle($request, Closure $next, $guard = null, $field = null)
    {
        if (!App::environment(config('auth.environments', ['staging']))) {
            return $next($request);
        }

        return parent::handle($request, $next, $guard);
    }
public function handle($request, Closure $next, $guard = null, $field = null)
    {
        if (!App::environment(config('auth.environments', ['staging']))) {
            return $next($request);
        }

        return parent::handle($request, $next, $guard);
    }
public function handle ( $ request , Closure $ next , $ guard = null , $ field = null ) { if ( ! App :: environment ( config ( 'auth.environments' , [ 'staging' ] ) ) ) { return $ next ( $ request ) ; } return parent :: handle ( $ request , $ next , $ guard ) ; }
Only allow authenticated users on environments specified in the auth config.

@param  \Illuminate\Http\Request  $request
@param  \Closure  $next
@param  string|null  $guard
@return mixed
Only allow authenticated users on environments specified in the auth config .