Redirecting outside of a controller
<p><strong>view.blade.php (JAVASCRIPT)</strong></p>

<pre><code>window.open(url);
</code></pre>

<p><strong>Controller</strong> </p>

<pre><code>echo '&lt;script&gt;window.close();';

Redirect::to('mainpage')-&gt;with('msgBox','Succuss');
</code></pre>

<p><code>Redirect</code> function does not work. After I open and close the plugin, I would like to redirect to the mainpage.</p>