Example of Custom validation rules in guillaumebriday/laravel-blog

File app/Rules/AlphaName.php (link to Github)
use Illuminate\Contracts\Validation\Rule;

class AlphaName implements Rule
{
    public function passes($attribute, $value)
    {
        if (! is_string($value) && ! is_numeric($value)) {
            return false;
        }

        return preg_match('/^(?:[\pL\pN\pM]+[\pZ\'_-])*[\pL\pN\pM]+$/u', $value) > 0;
    }

    public function message(): string
    {
        return trans('validation.alpha_name');
    }
}
File app/Http/Requests/UsersRequest.php (link to Github)
use App\Rules\AlphaName;
use Illuminate\Foundation\Http\FormRequest;

class UsersRequest extends FormRequest
{
    public function rules(): array
    {
        return [
            'name' => ['required', 'string', 'max:255', new AlphaName],
            'email' => 'required|email|unique:users,email,' . auth()->user()->id,
        ];
    }
}

Additional resources on custom validation rules: