PHPackages                             myerscode/laravel-domain-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. myerscode/laravel-domain-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

myerscode/laravel-domain-validator
==================================

Validate Domains names in Laravel using PHP Domain Parser.

13.0.0(1mo ago)213MITPHPPHP ^8.5CI passing

Since May 2Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/myerscode/laravel-domain-validator)[ Packagist](https://packagist.org/packages/myerscode/laravel-domain-validator)[ Docs](https://github.com/myerscode/laravel-domain-validator)[ RSS](/packages/myerscode-laravel-domain-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (8)Used By (0)

Laravel Domain Validator
========================

[](#laravel-domain-validator)

> A Laravel package for validating domain properties

[![Latest Stable Version](https://camo.githubusercontent.com/dafc8864f6b92078dadd729f29aa22c0183783feb0d25e6ff586bf059ce62e9a/68747470733a2f2f706f7365722e707567782e6f72672f6d79657273636f64652f6c61726176656c2d646f6d61696e2d76616c696461746f722f762f737461626c65)](https://packagist.org/packages/myerscode/laravel-domain-validator)[![Total Downloads](https://camo.githubusercontent.com/209929281d3f2fc8abc03bcfe45e0f4bd07a4c55343828b7a3b3a0031cc67e6e/68747470733a2f2f706f7365722e707567782e6f72672f6d79657273636f64652f6c61726176656c2d646f6d61696e2d76616c696461746f722f646f776e6c6f616473)](https://packagist.org/packages/myerscode/laravel-domain-validator)[![PHP Version Require](https://camo.githubusercontent.com/8704c2dd4260af21f8f4af5feafa6c553790df6dffbcc1e9403fa8eaaf5c6af1/687474703a2f2f706f7365722e707567782e6f72672f6d79657273636f64652f6c61726176656c2d646f6d61696e2d76616c696461746f722f726571756972652f706870)](https://packagist.org/packages/myerscode/laravel-domain-validator)[![License](https://camo.githubusercontent.com/2b0f8f65287c4a720a7902cdf0e233e8bf90d3cec320995f9d7c239a2aec13d2/68747470733a2f2f706f7365722e707567782e6f72672f6d79657273636f64652f6c61726176656c2d646f6d61696e2d76616c696461746f722f6c6963656e7365)](https://github.com/myerscode/laravel-domain-validator/blob/main/LICENSE)[![Tests](https://github.com/myerscode/laravel-domain-validator/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/myerscode/laravel-domain-validator/actions/workflows/tests.yml)[![codecov](https://camo.githubusercontent.com/0651740203362f9c4796595e40d495e3aa5e96d2177468d1807b827f88f598aa/68747470733a2f2f636f6465636f762e696f2f67682f6d79657273636f64652f6c61726176656c2d646f6d61696e2d76616c696461746f722f67726170682f62616467652e737667)](https://codecov.io/gh/myerscode/laravel-domain-validator)

Requirements
------------

[](#requirements)

- PHP ^8.5
- Laravel ^13.0

Why is this useful?
-------------------

[](#why-is-this-useful)

It allows easy integration of the [PHP Domain Parser](https://github.com/jeremykendall/php-domain-parser) PHP Domain Parser by [Jeremy Kendall](https://github.com/jeremykendall) into a Laravel app, in order to validate values against known domain data.

Installation
------------

[](#installation)

The package can be installed via composer:

```
composer require myerscode/laravel-domain-validator
```

Usage
-----

[](#usage)

Fetch data sets

```
artisan domain-validator:fetch
```

Cache the fetched data sets

```
artisan domain-validator:cache
```

Do both together!

```
artisan domain-validator:refresh
```

Scheduling
----------

[](#scheduling)

It is recommended to schedule the refresh command, in order to remove the need of running the `domain-validator:refresh` command every time you need to update your cache.

```
// routes/console.php

Schedule::call('domain-validator:refresh')->daily();

// alternatively initialize a new command class

Schedule::call(new \Myerscode\Laravel\DomainValidator\Commands\RefreshCommand)->daily();
```

Checks
------

[](#checks)

Note: For developer experience, all strings passed will be sanitized to remove trailing slashes `/` and `http(s)://`.

### Has ICANN Suffix

[](#has-icann-suffix)

> Tells whether the effective TLD has a matching rule in a Public Suffix List ICANN Section.

```
hasICANNSuffix('myerscode.com') // true

hasICANNSuffix('cloudfront.net') // false
```

### Has Known Suffix

[](#has-known-suffix)

> Tells whether the effective TLD has a matching rule in a Public Suffix List.

```
hasKnownSuffix('myerscode.co') // true

hasKnownSuffix('myerscode.corgi') // false
```

### Has Private Suffix

[](#has-private-suffix)

> Tells whether the effective TLD has a matching rule in a Public Suffix List Private Section.

```
hasPrivateSuffix('myerscode.cloudfront.net') // true

hasPrivateSuffix('cloudfront.net') // false
```

### Is Domain

[](#is-domain)

> Is the value parseable as to a valid domain

```
isDomain('myerscode.com') // true

isDomain('.com') // false
```

### Is TLD

[](#is-tld)

> Is the value a valid Top Level Domain

```
isTld('.com') // true

isTld('.corgi') // false
```

Issues
------

[](#issues)

Bug reports and feature requests can be submitted on the [Github Issue Tracker](https://github.com/myerscode/laravel-domain-validator/issues).

Contributing
------------

[](#contributing)

We are very happy to receive pull requests to add functionality or fixes. Please read the Myerscode [contributing](https://github.com/myerscode/docs/blob/main/CONTRIBUTING.md) guide for information.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance90

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 97.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~173 days

Total

5

Last Release

50d ago

Major Versions

11.1.1 → v2025.0.02025-11-17

PHP version history (3 changes)11.0.0PHP ^8.2

v2025.0.0PHP ^8.4

13.0.0PHP ^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3d9923c8c4269fbe7076613da7e814719743f643cb115b441ccee8aeaa1290e?d=identicon)[oniice](/maintainers/oniice)

---

Top Contributors

[![oniice](https://avatars.githubusercontent.com/u/2676321?v=4)](https://github.com/oniice "oniice (43 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelianaicanndomain parser

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/myerscode-laravel-domain-validator/health.svg)

```
[![Health](https://phpackages.com/badges/myerscode-laravel-domain-validator/health.svg)](https://phpackages.com/packages/myerscode-laravel-domain-validator)
```

###  Alternatives

[bakame/laravel-domain-parser

Laravel package to integrate PHP Domain parser.

26534.8k4](/packages/bakame-laravel-domain-parser)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
