<?php

namespace App\Http\Middleware;

use Closure;

class HttpsToHttp
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (!app()->isLocal() && starts_with($request->getRequestUri(), '/stub-docs')) {
            config('app.url', 'http://release.fenpeiduixiang.com');
        }
        $response = $next($request);

        return $response;
    }
}
