#save filter data in variable
23 messages · Page 1 of 1 (latest)
Can you explain your goal more?
i have purchases table ``` $query = Purchase::where('supplier_id', $this->supplierId)
and im taiiking data like this next
i take data frm purchase using status if ($this->status !== null) { // Handle filtering by status $query->where('status', $this->filters); }
``` i have status variable like this
i want to use it to get puurchases items where stattus == my status variable
i create filter in my widget like this ``` protected function getFilters(): ?array
{
return [
null => 'Show All',
0 => 'In Progress',
1 => 'Order',
2 => 'Completed',
3 => 'Cancelled',
];
}
and i want when i select in progress save 0 in status variable and use it to take purchases items where status === 0
u get it?
If you have created a filter it will filter the table by the selected value.... But where are you wanting to save it? I am not understanding.
look i have chart widget
which have filter in right side
{
return [
null => 'Show All',
0 => 'In Progress',
1 => 'Order',
2 => 'Completed',
3 => 'Cancelled',
];
}```
this filter
and i want like if i select In progress i want to take data from purchases where status == selected status
??
anyone please?
So you want to filter the resource data from the widget filter form? Is that correct?
yes i have filter for my widget