outl1ne / nova-settings

A Laravel Nova tool for editing custom settings using native Nova fields.
MIT License
274 stars 96 forks source link

Nova Field rules do not work #4

Closed cgarofalo closed 4 years ago

cgarofalo commented 4 years ago

The ->rules() method does not work on the fields.

royduin commented 4 years ago

Fixed: https://github.com/optimistdigital/nova-settings/pull/7

Tarpsvo commented 4 years ago

Released in version 1.4.0. (Also let it be said, the previous version "2.3.0" was a typo and was supposed to be "1.3.0").

royduin commented 4 years ago

No problem, thanks @Tarpsvo 👍

royduin commented 4 years ago

2.3.0 is still visible at Packagist, maybe resync them @Tarpsvo? https://packagist.org/packages/optimistdigital/nova-settings#2.3.0

Tarpsvo commented 4 years ago

Thanks for letting me know! Deleted the version manually.

msouto346 commented 4 years ago

Hello I am not sure if this is fixed. For example if I use ->min(0)->rules('min: 0') on a Number field the select buttons don't allow me to choose a negative number but if I manually type it into the field, it will save with for example -150 in it and update my env file with the negative number. I am using 1.4.0 version but also tried it with the last version and the outcome was the same.

Tarpsvo commented 4 years ago

@cantThinkOfAnything-1 Hi! Sorry for the late response. I tested it and it seems like you have to ensure it's a numeric value you're checking the 'min' of. So, the rule should be:

->rules('numeric', 'min:0')
msouto346 commented 4 years ago

That works. Thank you for your help @Tarpsvo