title: How can I get URLs params from my Laravel Controller using Vue
body: <p>I am trying to get the query string params. I have tried everything I can find on SO as well as general Google searches such as follows.</p>
  
  <pre><code>URL = http://example.com?companyId=1&amp;subcompany=3;
  Then in my controller:
  $companyId = $request-&gt;query('companyId');
  $subcompany = $request-&gt;query('subcompany);
  </code></pre>
  
  <p>So, if I go to mysite.com/api/getcompany?companyId=1&amp;subcompany=3, I see exactly what I expect. I even get back the results that I expect to get.
  The problem is that then when this passes back to Vue, it is not at all what I expect. Instead, I get a list of all companies that are in the database with a null value for companyId and null value for subcompany.
  In looking at Telescope, the query that is actually processed is </p>
  
  <pre><code>select * from `prods` where
    (
      `companyId` = '..'
      and `subCompany` = ''
    )
    and `products`.`deleted_at` is null
  </code></pre>
  
  <p>Yet, in my controller method this is what I am passing in </p>
  
  <pre><code>    $products = Prod::where([
          ['companyId', '=', $companyId ],
          ['subcompany','=', $brandId]
                                 ])
          -&gt;get();
  </code></pre>
  
  <p>In my Vue component, this is how I am making the call,</p>
  
  <pre><code>axios.get("api/getProds").then(res=&gt;{
    console.log(res.data);
  });
  </code></pre>
  
  <p>So, not actually passing in the companyId as I don't have it available in the JS. Instead, I need to extract it from the query string. 
  I am obviously missing something but I can't figure out what it is. Can someone see what is wrong with my code?</p>