-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Prefix needed on Custom Validation Rules CP example. #1612
Comments
Your rule classes can be anywhere, they don't need to be in App\Rules. |
But, at least having a consistent example would be good, I agree! |
Well, since the example starts by pointing to the Laravel docs, and the Laravel docs use |
However, until right now I had not really realized this was due to the namespace and not the filesystem. It is that So maybe the docs could be a bit more explicit, saying something like, "don't forget to include any namespace prefix your rule may require." I imagine a lot of Statamic users are, like me, new to Laravel and not even all that familiar with concepts like namespaces. Little reminders would go a long way toward bringing us along. |
Not sure how to put in a request to fix a docs illustration, since I don't have the tools to make a new illustration.
In the Custom Validation Rules docs the illustration fails to show the
App\Rules\
prefix that should go on any custom rule, even when defining it in the CP. This prefix is shown in the YAML example, but by not appearing in the CP example it strongly implies the prefix is only needed in the YAML.Wrong, the prefix is needed in the CP as well. I just spent half an hour fumbling to learn this. It would be nice if the illustration were fixed.
Thanks!
The text was updated successfully, but these errors were encountered: