Open wamesro opened 10 months ago
Is it possible to change the sort of items? We would need 2019 to be at the beginning
In the preview you have it with your own sort https://github.com/stepanenko3/nova-boolean-group-field/raw/main/screenshots/field.png
I tried both krsort() and array_reverse()
krsort()
array_reverse()
We use it in Action
Select::make(__('order_item.action.bulk.field.product'), 'product') ->help(__('order_item.action.bulk.field.product.help')) ->options(ProductController::getActiveProducts()) ->searchable() ->required() ->rules('required'), BooleanGroup::make(__('order_item.action.bulk.field.variant'), 'variant') ->help(__('order_item.action.bulk.field.variant.help')) ->required() ->rules('required') ->dependsOn('product', function (BooleanGroup $field, NovaRequest $request, FormData $formData): void { $options = []; $productId = $formData->product; if ($productId) { $options = ProductVariantController::getVariantsByProductId($productId); } $field->options(0 === count($options) ? [] $options); }),
Is it possible to change the sort of items? We would need 2019 to be at the beginning
In the preview you have it with your own sort https://github.com/stepanenko3/nova-boolean-group-field/raw/main/screenshots/field.png
I tried both
krsort()
andarray_reverse()
We use it in Action