strtolower() expects parameter 1 to be string, array given
<p>I'm using Laravel for a simple API that routes users from:</p>

<pre><code>Route::get('api/v1/mu/{dte?}', 'API\APIController@MUIntervalAPICall');
</code></pre>

<p>to this controller:</p>

<pre><code>public function MUIntervalAPICall(Request $dte)
{
  $date = $dte-&gt;dte;
  $element_language = $dte-&gt;language;
  $element_customer = $dte-&gt;customer;
  $mu_interval = MUInterval::select("SELECT :element_language, :dte, :element_customer, null, null, null, null, null, null, null, null, null, null, null"
  , ["element_language" =&gt; $element_language, "dte" =&gt; $date, "element_customer" =&gt; $element_customer])-&gt;get()-&gt;toArray();
  function array_to_xml( $data, &amp;$xml_data ) {
      foreach( $data as $key =&gt; $value ) {
          if( is_array($value) ) {
              $key = 'Exception';
              $subnode = $xml_data-&gt;addChild($key);
              array_to_xml($value, $subnode);
          } else {
              $xml_data-&gt;addChild("$key",htmlspecialchars("$value"));
          }
       }
  }
  $xml_data = new SimpleXMLElement('&lt;?xml version="1.0"?&gt;&lt;muExceptions&gt;&lt;/muExceptions&gt;');
  array_to_xml($mu_interval,$xml_data);
  $result = $xml_data-&gt;asXML();
  return Response::make($result, '200')-&gt;header('Content-Type', 'text/xml');
}
</code></pre>

<p>A url I tested (<a href="http://localhost:8000/api/v1/mu/2016-02-13?customer=Apple&amp;language=English" rel="nofollow noreferrer">http://localhost:8000/api/v1/mu/2016-02-13?customer=Apple&amp;language=English</a>) gives out this error:</p>

<p><a href="https://i.stack.imgur.com/mEUxq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mEUxq.png" alt="enter image description here"></a></p>

<p>What causes this? Users would technically put in date?language=&amp;customer= or date?customer= or date?language= or simply just date? but none works.</p>

<p>How would I fetch the values in the URL I mentioned and use it in my query?</p>