ITADN

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

#97Openbocanhcam 创建于 2024-04-23
B
bocanhcamcommented
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. ```php 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); } } ``` ```php public function filters(NovaRequest $request): array { return [ MegaFilter::make([ //..another filer, OrderPaymentStatusFilter::make(), ]) ]; } ```
4 条评论