Using DB facade inside a Table Widget
I wanted to show some data not related to a single Eloquent modes in a Table Widget and provided my query using DB facade inside Table Widget's query() method but it turns out that the query method only accepts \Illuminate\Database\Eloquent\Builder. Is it possible to pass base query builder object?
4 Replies
Does this data stand on its own? Or does it need to be related to the table record?
You could try
getStateUsing()
if you need to do your own thing instead of the usual querying that is done for a table cell.What I am trying is to aggregate values from different tables as statistics and show them in a Table widget. Since data is not bound to any model I was using DB facade but it turns out that Table widget only accepts Eloquent Builder object.
is this problem solved or not
I refactored the query around the main Model. This way table widget rendered the result without any problems. So you need to write that complex query around the most important model π