laravel error "strtolower() expects parameter 1 to be string"?
<p>I am passing json to a laravel route as following and I am runnig this query sql view.</p>

<blockquote>
  <p>{"columns":["fname","lname","mobile"], "offset":"1", "limit":"25",
  "order":[["fname","asc"],["lname","asc"]],
  "filter":[["gender","=","M"]]}</p>
</blockquote>

<p><strong>And this is the function placed in controller which will going to call on route</strong></p>

<pre><code>public function fetch_contacts(Request $request){
    if($request-&gt;header('content-type') == 'application/json' &amp;&amp; !empty($request-&gt;header('Device')) &amp;&amp; !empty($request-&gt;header('UID'))){
          $query = DB::connection('mysql_freesubs')-&gt;table("contact_view")
              -&gt;select($request-&gt;columns);

              if(!empty($request-&gt;filter))
                $query = $query-&gt;where($request-&gt;filter);

              if(!empty($request-&gt;offset))
                $query = $query-&gt;offset($request-&gt;offset);

              if(!empty($request-&gt;limit))
                $query = $query-&gt;limit($request-&gt;limit);

              if(!empty($request-&gt;order))
                $query = $query-&gt;orderBy($request-&gt;order);

              $contacts = $query-&gt;get();
              return $contacts;
}
</code></pre>

<p><strong>where am I going wrong ?</strong></p>