Laravel 5: Redirecting to external link on POST request
<p>The function below is called through a POST request. I need to retrieve URL from my database and open the link in a new tab. I'm using the <code>Redirect::away()</code> function for this. But it gives a <code>MethodNotAllowedHttpException</code>. I have tried calling this function in a GET request and it works perfectly fine.</p>

<pre><code>public function generateURL(Request $request) {

    $screenRow = \App\ScreenshotRow::find($request-&gt;input('row_ID'));
    $baseURL = $screenRow-&gt;BaseURL;

    $screenshot = \App\Screenshot::where('Setname', '=', $screenRow-&gt;Setname)-&gt;get();
    $pageURL = $screenshot[0]['PageURL'];

    if ($baseURL == "") {
        return Redirect::away($PageURL);
    }

    else
        return Redirect::away($baseURL);
}
</code></pre>

<p>Is there any way to calling this function in response to a POST request?</p>