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 ValidUuid implements Rule
{
/**
* Check uuid is valid.
*/
public function passes($attribute, $value): bool
return preg_match('/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/', $value);
return preg_match('/^[0-...a-fA-F]{12}$/', $value)
integer
boolean
}
* Get the validation error message.
public function message(): string
return __('validate.uuid');