nova-mega-filter
nova-mega-filter copied to clipboard
The select filter does not change when the nova select filter changes
I have a select filter like the one below.
The problem is when I change the select option in the original filter of Nova then the select option in MegaFilter does not change.
If it's the opposite, no problem.
class OrderPaymentStatusFilter extends Filter
{
/**
* The filter's component.
*
* @var string
*/
public $component = 'select-filter';
public $name = "入金";
public function apply(NovaRequest $request, $query, $value)
{
$value = array_search($value, PaymentStatus::get());
return $query->where('payment_status', $value);
}
}
public function filters(NovaRequest $request): array
{
return [
MegaFilter::make([
//..another filer,
OrderPaymentStatusFilter::make(),
])
];
}