KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Dynamic QueryBuilder #1078

Closed Mike Carroll opened this topic on on Sep 10, 2019 - 1 comments

Mike Carroll commented on Sep 10, 2019

Are there any examples on how to use query builder but in a dynamic fashion. From the examples, they appear to all be static. Hope my question makes sense.

KoolReport commented on Sep 11, 2019

Let say you have report parameter like $this->params["start_date"] and $this->params["end_date"] you can do:

DB::table("orders")->whereBetween(
    "order_date",
    [$this->params["start_date"],$this->params["end_date"]]
);

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

QueryBuilder