Closed stuartcusackie closed 1 year ago
Validator::extend() seems to be abandoned in recent versions of Laravel
What makes you say this? It still works fine. Use that.
I did not read that the Validator is abandoned, but this is an example from the Statamic codebase:
https://github.com/statamic/cms/blob/3.3/src/Providers/ValidationServiceProvider.php
Yep, just realised this. Laravel have removed it from the documentation. Perhaps they are planning to remove it but it still works for now.
Thanks!
I can't find any recent information on how to add a custom Laravel validation rule to a field.
You usually do this like so in a controller:
but I don't see how we could do this in yaml and Validator::extend() seems to be abandoned in recent versions of Laravel. It would be great if we could do something like this:
Any recommend strategies?