How to make dynamic query in laravel 5.3?
<p>What exactly I wanna do is, I want to make dynamic query in laravel 5.3 based on requested parameters , so in request i will get column names then filters for that query and I don't know tables from which I want to process the data.
So, my question is how to decide the tables for that query ?
or should I store table and respective columns in one database's table and match the requested parameters with that table so that I will get table name and will able to put in that query?</p>

<p>But I thought this will cost my processing ? so that's why I post this question. please help me with best scenario that will fit with my requirment for dynamic query?</p>

<p><strong>Update</strong></p>

<p>the request will be like this</p>

<pre><code>{
  "col": ['fname', 'lname'],
  "offset": 1,
  "limit": 25,
  "order": [ASC, fname, lname],
  "filter": [
    {
      "col": "id",
      "op": "=",
      "val": 8
    }
  ]
}
</code></pre>

<p>so this is my request and table name and related columns are in one table.</p>