title: Laravel 5.2 Authentication Redirect with Parameters
body: <p>Since, I was not able to find any question like this in SO, I am writing this post hoping this is not a duplicate... </p>
  
  <p>I have a page developed using <strong>KnockoutJs</strong> which I am using to protect via Laravel Authentication. Basically, <strong>I am using Laravel only for the purpose of login/registration</strong> and once the user logs/signs in, he is redirected to the KnockoutJS page. </p>
  
  <p>Now lets just say I have a URL, </p>
  
  <pre><code>http://example.com/mypage#q=some+parameters&amp;p=somethingsomething
  </code></pre>
  
  <p>If I share that URL with one of my friends, it obviously redirects my friend to the Login Page. Now, the login page URL (where he is redirected to) is</p>
  
  <pre><code>http://example.com/login#q=some+parameters&amp;p=somethingsomething
  </code></pre>
  
  <p>But once he logs in, he is being redirected to </p>
  
  <pre><code>http://example.com/mypage#
  </code></pre>
  
  <p>Which obviously is not right, because I need the parameters to be there... </p>
  
  <p>My <strong>Routes</strong> page is as follows,</p>
  
  <pre><code>Route::group(['middleware' =&gt; 'web'], function() {
      Route::auth();
      Route::get('/', 'MainController@index')-&gt;name('home.index');
  });
  
  Route::group(['middleware' =&gt; ['web','auth']], function () {
      Route::get('/mypage', 'MyController@index')-&gt;name('mypage.index');
  });
  </code></pre>
  
  <p>And my <strong>AuthController</strong> has the <strong>redirectTo</strong> Url set</p>
  
  <pre><code>protected $redirectTo = '/mypage';
  </code></pre>
  
  <p>What change should I do (in AuthController, or in Routes? Or in a MiddleWare) to redirect the user to </p>
  
  <pre><code>http://example.com/mypage#q=some+parameters&amp;p=somethingsomething
  </code></pre>
  
  <p>after login?</p>