filter(function ($domain) use ($value) { return Str::endsWith(strtolower($value), '.'.$domain) || strtolower($value) === $domain; }) ->count(); if ($count !== 0) { $fail('The domain cannot be a local one.'); } } }