I'm having difficulty figuring out how to write a custom validation rule in Laravel 5.1. I've read the documentation, but it seems incomplete. Looking it over, I just don't see where I'm supposed to put my actual validation logic, such as if (stristr($string, 'test')) { ... and so on.
For another thing, it doesn't show in what method/array the error message defintions should go:
"foo" => "Your input was invalid!",
"accepted" => "The :attribute must be accepted.",
// The rest of the validation error messages...
My actual use case is somewhat strange, so for this question, let's use the example of validating a secure password. A secure password must be at least 8 characters long, containing a lowercase and uppercase letter, a number and a special character.
Actually, that's a pretty tall order for an example, so how about just checking for a number? Or running any string function on the value?
How would one create such a validation rule?