for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Milwad\LaravelValidate\Rules;
use Illuminate\Contracts\Validation\Rule;
class ValidUlid implements Rule
{
/**
* Check ulid is valid.
*/
public function passes($attribute, $value): bool
return preg_match('/[0-7][0-9A-HJKMNP-TV-Z]{25}/', $value);
return preg_match('/[0-7...NP-TV-Z]{25}/', $value)
integer
boolean
}
* Get the validation error message.
public function message(): string
return __('validate.ulid');