phpdotenv icon indicating copy to clipboard operation
phpdotenv copied to clipboard

Add `withDefault` method & caster for Validator

Open ahjdev opened this issue 5 months ago • 0 comments

Like:

$dotEnv->ifPresent('DB_CHARSET')->withDefault('utf8mb4', allowEmpty: false); // sometimes we need empty string

Also a caster will be good too (since dot env load all as string and maybe we want integer value

ahjdev avatar Aug 02 '25 19:08 ahjdev