- How do I install h-farm/laravel-email-domain-rule?
- Install it with Composer using composer require h-farm/laravel-email-domain-rule. Laravel package discovery should register the service provider automatically. You can optionally publish the config if you need custom domain policy or messages.
- What does the Laravel email domain rule actually validate: allowlist or denylist?
- The package is designed to constrain acceptable email domains by allowing or blocking specific domains, including disposable and corporate filters. It is a domain-policy rule, not a full email deliverability or DNS/MX reachability check. Confirm the exact allowlist and denylist behavior in the README and config before relying on it for signup policy.
- Can I block disposable email domains on a Laravel registration form?
- Yes. The package supports filtering disposable email domains as part of its domain rule configuration. Add the rule to your form request or Validator::make call for the email field. Review whether the disposable list is bundled or configurable so you know how it stays current.
- How do I allow only specific email domains in a Laravel form request?
- Use the package rule string on the email field in your form request rules method. Configure the allowed domains according to the package config, then let Laravel return the standard validation error. This keeps domain policy close to the request validation rather than scattering checks through controllers.
- Do I need to publish the config file for laravel-email-domain-rule?
- Publishing config is optional and mainly useful when you need to customize allowed or blocked domains, disposable/corporate behavior, or validation messages. If the defaults match your policy, you can use the rule with minimal setup. Run vendor:publish only when you need to own and version the configuration.
- Does it support Laravel 10, Laravel 11, and PHP 8.3?
- Release 3.2.0 adds Laravel 11.x and PHP 8.3 support, but whether Laravel 10 remains supported should be confirmed in composer.json. Diff the 3.1.x and 3.2.0 composer constraints rather than assuming semver alone. The minor version suggests a constraint-widening release, not a behavioral rewrite.
- Does the email domain rule make DNS or MX network calls during validation?
- The package is presented as a domain allow/block rule, not a DNS or MX deliverability checker. Still confirm in the source and config whether any domain list refresh requires outbound network access. For signup paths, prefer static bundled lists so validation does not add latency or timeout risk.
- How do I test the email domain validation rule in Laravel?
- Use Laravel's validator directly in a feature or unit test with known allowed and blocked domains, then assert passes, failures, and messages. If the package uses bundled lists, tests do not need external services. Keep at least one test for disposable or corporate filtering if that policy matters to your application.
- Is this package safe to use in production registration flows?
- It is a narrow validation rule that plugs into Laravel's native validator, so integration risk is low. The main production concerns are domain-list freshness and whether the rule performs any network I/O. Pin the package version, review its config, and avoid DNS-style checks on latency-sensitive signup paths unless you have clear timeout and failure semantics.
- What should I do if laravel-email-domain-rule is abandoned or the domain list is stale?
- Because the rule is small, replacing it with a custom Laravel Rule using explicit allow, deny, or disposable-domain arrays is straightforward. Check the license first so a source-available fork or internal copy is acceptable. Before adoption, confirm how the domain corpus is sourced and updated so staleness does not silently weaken your signup policy.