title: How to get redirect route from laravel redirectResponse?
body: <p>So I'm trying to test my laravel’s middleware which will return redirection.</p>
  <p>If the request did not satisfy the middleware’s requirements, the request will be redirect using <code>redirect()-&gt;route('name')</code></p>
  <p>I tried getting the return value from the middleware like so</p>
  <pre><code>$response = $middleware-&gt;handle($request, function ($req) { return $req; }, 'server:summary:view:edit');
  \Log::info($response);
  </code></pre>
  <p>the <code>$response</code> is instance of <code>Illuminate\Http\RedirectResponse</code>.
  When I do <code>\Log::info($response);</code> I get this result.</p>
  <pre><code>HTTP/1.0 302 Found
  Cache-Control: no-cache, private
  Date:          Mon, 13 Jul 2020 08:12:27 GMT
  Location:      https://myrandomurl.test/name
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset=&quot;UTF-8&quot; /&gt;
          &lt;meta http-equiv=&quot;refresh&quot; content=&quot;0;url='https://myrandomurl.test/name&quot; /&gt;
  
          &lt;title&gt;Redirecting to https://myrandomurl.test/name&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          Redirecting to &lt;a href=&quot;https://myrandomurl.test/name&quot;&gt;https://myrandomurl.test/named&lt;/a&gt;.
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>So how do I get the url from the Location tag ? or How do I get the redirect url from laravel redirectResponse ?</p>
  <p>I tried browsing the doc at <a href="https://laravel.com/api/5.8/Illuminate/Http/RedirectResponse.html#method_content" rel="nofollow noreferrer">https://laravel.com/api/5.8/Illuminate/Http/RedirectResponse.html#method_content</a> but there's no method that shows redirect route.</p>
  <p>I need the route to assert it for successful test result.</p>