Created
August 2, 2013 14:42
-
-
Save gazoakley/6140388 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$rules = array( | |
'description' => 'required|naughtywords', | |
); | |
Validator::extend('naughtywords', function($attribute, $value, $parameters) | |
{ | |
return strpos($str, 'a***') === FALSE | |
}); | |
$messages = array( | |
'naughtywords' => 'The :attribute must not contain naughty words', | |
); | |
Validator::make(Input::all(), $rules, $messages); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment