Closed nafiesl closed 4 years ago
I think for now we're good with using setModel
.
Could you give me on which use-case this scenario happen ?
Because naturally all database should have 1 model, except a pivot of course.
I was planned to research a lumen/laravel API application with 1 endpoint which will accept this kind of request params:
page[limit]=100
page[offset]=200
table=users
filter[is_active][is]=1
Basically we will run an SQL query to a table which we can set dynamically from the request param.
Don't you think it's better applied on the controller instead ? It will easily done with setModel
.
I think it will be bloated if we add table name too on the request.
Got it @LIQRGV. I will try to implement it on the controller instead. :+1:
Hi @LIQRGV, if I may propose for a new feature, how if we support to use a query builder by allowing users to set a table name. I am thinking we have something like this:
Then we will get this query behind the scene:
If this is acceptable to you, I can contribute to prepare the PR.
Thanks.