Skip to content

Get current filtered table sql? Save current component state with the filters? #1297

Discussion options

You must be logged in to vote

1 - After doing some digging on the source code I was able to figure out how to get the raw SQL of the current state of the grid.
This is going to be useful for me, because I want my user to be able to save a query of the current filters the user have and that will bring a list of notifiables, that will allow me to reach out to the people on that resultset that the user has save accorting to his desire.
The code below was extracted from ProcessDataSource.php at processModel private function. I was able to copy the snippet to my descendant component and do what I needed.

  
$results = $this->datasource()
      ->where(
        fn (EloquentBuilder|QueryBuilder $query) => \PowerComponents\Li…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by viniciusalvess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant