Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Email Domain Rule Laravel Package

h-farm/laravel-email-domain-rule

A Laravel validation rule for checking the domain of an email address. Allow or block specific domains, filter disposable or corporate emails, and get clear validation messages—drop it into form requests or validators with minimal setup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. maize-tech/laravel-email-domain-rule is a narrow, single-purpose validation package: it registers a custom Laravel validation rule (and matching service provider / config surface) for constraining which email domains are acceptable on a given field. Architecturally this is the lowest-risk integration shape available in Laravel — it plugs into the framework's native validator extension points rather than introducing a new runtime, a facade with global state, or middleware into the request lifecycle. It does not touch persistence, queueing, auth, or the container in ways that would constrain application design. Fit is good for form requests, Validator::make() calls, and Filament/Livewire form definitions, provided the team is comfortable expressing domain policy as a rule string rather than as domain logic in a service class.

Integration feasibility. Composer-only dependency with no infrastructure prerequisites, no migrations, and no external service account. Expected footprint is a composer require, an optional php artisan vendor:publish for the config, and one rule string per validated field. Realistic effort for a first working integration is well under a day; the dominant cost is policy definition (which domains to allow or deny), not wiring.

Technical risk. Code-level risk is low: small surface area, no I/O expectations stated, and the 3.2.0 release is a compatibility bump rather than a behavioural change. The material risks are elsewhere:

  • Maintenance/bus factor. Maintained by a single agency (maize-tech) with a small contributor set. Historically the project has tracked framework majors reactively — this release adds Laravel 11.x and PHP 8.3 support roughly in line with the framework's own release cadence, which is reassuring but implies that a future Laravel 12 would similarly require a maintainer-initiated PR. Treat framework-upgrade timing as partially outside our control.
  • Data staleness. The package's usefulness depends on the domain set it evaluates against. The release notes say nothing about how that set is sourced, whether it is bundled statically, or whether it is updatable. A bundled list decays; a remotely fetched list introduces a network dependency. This is the single largest unknown and should be resolved before adoption.
  • Semantics of the rule. "Email domain rule" could mean an allowlist, a denylist of disposable/free providers, or a DNS/MX reachability check. These have very different failure characteristics — a denylist produces false negatives (disposable signups), a DNS check produces latency and timeouts on the signup path, and an allowlist produces false positives that block legitimate B2B users. The release notes do not disambiguate.
  • Version-line signal. Shipping this as 3.2.0 rather than 4.0.0 indicates the maintainers do not consider the Laravel 11 / PHP 8.3 work breaking, which is consistent with a constraint-widening change. Confirm by diffing composer.json between 3.1.x and 3.2.0 rather than trusting the semver alone.

Key questions.

  1. What exactly does the rule assert — allowlist, denylist, or DNS/MX resolution — and is the behaviour configurable?
  2. Is the domain corpus bundled in the package, published to config, or fetched at runtime? If bundled, how is it refreshed, and how stale is it today?
  3. What are the declared composer.json constraints for laravel/framework, illuminate/*, and php after this release? Does it still support Laravel 10, or did 3.2.0 silently drop it?
  4. Is there a changelog entry beyond the two PR titles confirming no behavioural change in the rule itself?
  5. Does the rule perform any outbound network call on the validation path? If so, what are the timeout and failure semantics (fail-open vs. fail-closed)?
  6. Test coverage and CI matrix — does CI actually exercise PHP 8.3 and Laravel 11, or was the constraint merely widened?
  7. What is the licence, and is a source-available fork acceptable if the package is abandoned?

Integration Approach

Stack fit. Targets Laravel applications on the 9.x–11.x line with PHP 8.1–8.3, assuming 3.2.0 widened rather than replaced constraints. Integration is idiomatic: the rule composes with required, email, max, and unique in the same rule array, and works identically in form requests, closures, and programmatic validators. It sits alongside — not in conflict with — Illuminate\Validation\Rules\Email and DNS-based rules such as email:dns / spoof, though overlapping DNS checks should be consolidated to avoid duplicate lookups.

Migration path. For an application already on 3.x, this is a routine composer update maize-tech/laravel-email-domain-rule with no code changes anticipated. For an application pinned to 2.x, treat 3.2.0 as a major-step upgrade: review the 3.0.0 breaking changes (namespace, config key names, rule signature), then step directly to 3.2.0 rather than landing on an intermediate. For greenfield adoption, install 3.2.0 directly and pin with a caret constraint (^3.2).

Compatibility. The two stated changes — PHP 8.3 and Laravel 11.x — are the compatibility items that matter, and both land in this release. Verify in the lockfile that the widened constraints do not collide with other transitive illuminate/support requirements; on Laravel 11 projects this is usually clean, but packages pinned to ^9.0|^10.0 will force a resolution failure. Confirm the rule is registered by the package's auto-discovered service provider — if the application sets dont-discover, the provider must be registered manually or the rule string will throw a "validation rule does not exist" error at runtime, which surfaces only when the field is validated.

Sequencing.

  1. Spike (0.5 day). Install in a scratch branch, publish config if present, read the rule source and composer.json diff for 3.1.x → 3.2.0, and answer the key questions above — especially corpus sourcing and network behaviour.
  2. Policy definition. Agree the business rule with product/trust-and-safety before writing code: allowlist vs. denylist, exception handling for existing users whose domains would now fail, and the user-facing error message (this is a signup-funnel surface and copy matters more than usual).
  3. Shadow mode. Roll out to staging and, if traffic allows, log-only in production for a short window to quantify how many real submissions the rule would reject. This is the cheapest way to catch an over-broad denylist before it costs signups.
  4. Enforce on the highest-value low-risk field first (typically registration), then extend to invite/profile-change flows.
  5. Add a regression test asserting both a pass and a fail case, so a future major bump that changes semantics is caught by CI rather than by the funnel.

Operational Impact

Maintenance. Expect low, bursty maintenance: near-zero between framework majors, then a required dependency bump whenever Laravel ships. Budget one small ticket per Laravel major release to validate the package has caught up; the 3.2.0 timing suggests the maintainers track reasonably promptly, but there is no SLA and no vendor contract behind it. Pin the constraint and let Renovate/Dependabot surface releases rather than floating.

Support. Community-only support via GitHub issues. For a security-adjacent validation rule this is acceptable given the small code surface and the fact that the rule is not a security control — it is a policy filter. Do not use it as the sole defence against abuse; pair it with rate limiting and email verification. Retain the option to vendor the source into the repo if the package goes dormant, which is a few hours of work given the size.

Scaling. Negligible if the rule evaluates a static, in-memory domain set — it is a hash lookup on a string already in memory, and adds nothing measurable to request latency. If instead it performs DNS/MX resolution per validation, cost scales with signup volume and is exposed to resolver latency and outages; in that case require caching of results per domain and a short timeout with fail-open behaviour, otherwise a DNS blip becomes a signup outage. Confirm which case applies before assuming the cheap one.

Failure modes.

  • False rejection (highest business impact). An over-broad denylist or a stale allowlist blocks legitimate users at registration. Silent, hard to attribute, and directly revenue-affecting. Mitigate with shadow-mode logging and a clear, actionable error message that tells the user what to do.
  • False acceptance. Denylist gaps let disposable or typo'd domains through. Cheap to tolerate given downstream email verification.
  • Stale corpus. Bundled lists decay; disposable-domain providers rotate frequently. Establish a refresh cadence or a periodic review ticket.
  • Silent rule non-registration. Auto-discovery disabled or provider not loaded causes a runtime exception only on the validated path — caught by the regression test in step 5.
  • Framework-upgrade blockage. If the maintainer lags a future Laravel major, the package becomes the pin holding the whole application back. Forking is cheap here; make that decision quickly rather than negotiating with an unresponsive upstream.
  • Network coupling. Only if DNS resolution is in scope — then timeouts, resolver failures, and added p95 latency on the signup endpoint.

Ramp-up. Hours for any engineer already fluent in Laravel validation; the package introduces no new mental model beyond "it's a rule string." The real ramp-up cost sits with product/trust-and-safety in defining and owning the domain policy, and that cost recurs every time the list is revisited. Document the policy rationale next to the config so the next engineer knows why a domain is excluded, not just that it is.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums