title: Get URL Param to Auth Login Controller in Laravel
body: <p>I've trying to get the <code>url param</code> of this</p>
  
  <p><code>http://localhost:8000/login?merchId=ABC&amp;param1=abc123&amp;param2=abc123</code></p>
  
  <p>These params are sent from another site whenever they are redirecting to my login page and the login page of my project should get all these params and perform some logical task in my controller.</p>
  
  <p>As stated above, I need to get the value of ff:</p>
  
  <p><code>merchId, param1 and param2</code></p>
  
  <p>In <code>php native</code>, I can simply use this code just to get these params</p>
  
  <p>using this:</p>
  
  <pre><code>$merchId = $_GET['merchId'];
  $param1 = $_GET['param1'];
  $param2 = $_GET['param2'];
  </code></pre>
  
  <p>But there's another way to do this.</p>
  
  <p>Currently my login for my project that I'm using is <code>Auth</code></p>
  
  <p>Here's my <strong>LoginController.php</strong> where I want to use and get the url params and perform some stuffs.</p>
  
  <pre><code>class LoginController extends Controller
  {
      use AuthenticatesUsers;
  
      protected function authenticated(Request $request, User $user){
          if($user-&gt;is_admin == 1){
              return  redirect('/admin/view/all');
          }
          else{
              return redirect('/reseller/reservation/view');
          }
      }
  
  
      /**
       * Create a new controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('guest')-&gt;except('logout');
      }
  }
  </code></pre>
  
  <p>Here's my <strong>Route</strong></p>
  
  <pre><code>Route::get('/','HomeController@index');
  Route::group(['middleware'=&gt; ['auth']], function(){
      Route::get('/reseller/reservation/view','ResellerController@reservation');
      Other routes included here no need to show......
  });
  </code></pre>
  
  <p>Here's my <strong>HomeController</strong></p>
  
  <pre><code>public function __construct()
  {
      $this-&gt;middleware('auth');
  }
  
  /**
   * Show the application dashboard.
   *
   * @return \Illuminate\Contracts\Support\Renderable
   */
  public function index()
  {   
  
      $searched = 0;
      $reseller = User::orderBy('created_at', 'desc')
      -&gt;where('is_blocked', '0')  
      -&gt;where('is_admin', '0')          
      -&gt;paginate(20);
      return view('pages.admin.view', compact('reseller', 'searched'));    
  }
  
  public function admin(Request $req){
      return view('middleware')-&gt;withMessage("Admin");
  }
  </code></pre>