Guest User

Untitled

a guest
Sep 5th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. ...->with(A-Z);
  2.  
  3. $rules = array(
  4. 'description' => 'required|naughtywords',
  5. );
  6.  
  7. Validator::extend('naughtywords', function($attribute, $value, $parameters)
  8. {
  9. return strpos($str, 'a***') === FALSE
  10. });
  11.  
  12. $messages = array(
  13. 'naughtywords' => 'The :attribute must not contain naughty words',
  14. );
  15.  
  16. Validator::make(Input::all(), $rules, $messages);
Advertisement
Add Comment
Please, Sign In to add comment