nova-mega-filter icon indicating copy to clipboard operation
nova-mega-filter copied to clipboard

The select filter does not change when the nova select filter changes

Open bocanhcam opened this issue 10 months ago • 4 comments

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(),
            ])
        ];
    }

bocanhcam avatar Apr 23 '24 03:04 bocanhcam