<?php

namespace App\Support;

use Illuminate\Validation\Rules\Password;

class PasswordRules
{
    /**
     * Standard-Regel gemäß config/password.php
     */
    public static function default(): Password
    {
        $rule = Password::min(max(1, (int) config('password.min_length', 10)));

        if (config('password.require_letters', true)) {
            $rule->letters();
        }

        if (config('password.require_mixed_case', true)) {
            $rule->mixedCase();
        }

        if (config('password.require_numbers', true)) {
            $rule->numbers();
        }

        if (config('password.require_symbols', false)) {
            $rule->symbols();
        }

        return $rule;
    }
}
