Skip to content

Instantly share code, notes, and snippets.

@gazoakley
Created August 2, 2013 14:42
Show Gist options
  • Save gazoakley/6140388 to your computer and use it in GitHub Desktop.
Save gazoakley/6140388 to your computer and use it in GitHub Desktop.
<?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