-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full stops in SKUs #874
Comments
Maybe we should allow for more options in the current config? At the moment we allow SKU to be required or not, and unique or not. Guess we could also add the validation type? Maybe there's a better approach to customising validation long-term, but I guess it would do for now? |
Yeah it might be worth letting devs override the alpha_num validation type if they want and let them specify their own validation rules? |
Yep. If you want to do a PR feel free. |
Just to jump in on this, it is actually possible, it's on 0.2 so I don't think it's in the current docs. Lunar\Hub\Http\Livewire\Components\Products\ProductCreate::extendValidation([
'variant.sku' => ['required', 'min:8'],
]);
Lunar\Hub\Http\Livewire\Components\Products\ProductShow::extendValidation([
'variant.sku' => ['required', 'min:8'],
]);
Lunar\Hub\Http\Livewire\Components\Products\Variants\VariantShow::extendValidation([
'variant.sku' => ['required', 'min:8']
]); |
@alecritson is this in the docs? I had a look at https://docs-next.lunarphp.io/ but can't see it. |
Not sure how docs-next works, but docs were added for it on the PR #443 |
Thanks @alecritson ! |
They run off the |
Found it https://github.com/lunarphp/lunar/blob/0.2/docs/src/extending/validations.md It hasn't been added to the side menu, hence it can't be found. |
SKUs on product variants have a validation rule of
alpha_dash
but we have a need to include dots in the SKU based on what a supplier is providing.Can the validation rule either be updated to accommodate this or can it be extendable to allow the rules to be defined by a dev?
The text was updated successfully, but these errors were encountered: