for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Torralbodavid\DuckFunkCore\Rules;
use Illuminate\Contracts\Validation\Rule;
class UsernameWithoutIllegalWords implements Rule
{
const ILLEGAL_WORDS = [
'MOD-',
];
/**
* {@inheritdoc}
*/
public function passes($attribute, $value)
foreach (self::ILLEGAL_WORDS as $bannedWords) {
if (stripos($value, $bannedWords) !== false) {
return false;
}
return true;
public function message()
return 'validation.user.illegal.words';