PHPackages                             labrodev/laravel-domain-keeper - 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. labrodev/laravel-domain-keeper

ActiveLibrary

labrodev/laravel-domain-keeper
==============================

Domain registrar-expiry reader for Laravel — RDAP first with a port-43 WHOIS fallback.

v1.0.0(yesterday)08↑2525%MITPHP ^8.4

Since Jul 22Compare

[ Source](https://github.com/labrodev/laravel-domain-keeper)[ Packagist](https://packagist.org/packages/labrodev/laravel-domain-keeper)[ Docs](https://github.com/labrodev/laravel-domain-keeper)[ RSS](/packages/labrodev-laravel-domain-keeper/feed)WikiDiscussions Synced today

READMEChangelogDependencies (9)Versions (2)Used By (0)

Laravel Domain Keeper
=====================

[](#laravel-domain-keeper)

Domain registrar-expiry reader for Laravel — RDAP first with a port-43 WHOIS fallback. Ask it for a domain and it returns the registrar expiry date as a `Carbon` instance; the package stores nothing and keeps no state between lookups.

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

[](#installation)

```
composer require labrodev/laravel-domain-keeper
```

Publish the config file:

```
php artisan vendor:publish --tag=domain-keeper-config
```

All environment variables are optional — the defaults work out of the box:

```
DOMAIN_KEEPER_RDAP_URL=https://rdap.org/domain/
DOMAIN_KEEPER_WHOIS_SERVER=whois.iana.org
DOMAIN_KEEPER_TIMEOUT=10
```

Reading a domain's expiry date
------------------------------

[](#reading-a-domains-expiry-date)

Type-hint the `RegistrarExpiryReader` contract — the service provider binds it to the RDAP-first implementation:

```
use Labrodev\DomainKeeper\Contracts\RegistrarExpiryReader;
use Labrodev\DomainKeeper\Exceptions\RegistrarExpiryNotFound;

class DomainExpiryCheckController
{
    public function __invoke(RegistrarExpiryReader $registrarExpiryReader)
    {
        try {
            $expiry = $registrarExpiryReader->expiryDate('example.com');
        } catch (RegistrarExpiryNotFound $registrarExpiryNotFound) {
            // Neither RDAP nor WHOIS produced a date; the message names the domain.
        }

        return $expiry->toDateString();
    }
}
```

How it resolves
---------------

[](#how-it-resolves)

1. **RDAP** — an HTTPS GET to `{rdap_url}{domain}` (default `https://rdap.org/domain/`, which redirects to the authoritative registry RDAP server). The reader picks the `expiration` event out of the RDAP `events` array. Plain HTTPS, so it works inside containers with no raw-socket access.
2. **IANA WHOIS referral** — when RDAP yields nothing, the domain is queried against the bootstrap WHOIS server (`whois.iana.org` by default) and the `whois:` referral line names the TLD's authoritative WHOIS server.
3. **Registrar WHOIS** — the referral server is queried for the domain and the expiry line is parsed (`Registry Expiry Date`, `Registrar Registration Expiration Date`, `Expiration Date`, `Expiry Date`, or `paid-till`).

Every failure along the way falls through silently to the next step; only when all three sources come up empty does the reader throw `RegistrarExpiryNotFound`.

Testing your own code
---------------------

[](#testing-your-own-code)

The raw port-43 socket lives in `Labrodev\DomainKeeper\Services\WhoisClient`, which the reader receives via constructor injection — swap it through the container to keep your suite off the network:

```
use Labrodev\DomainKeeper\Services\WhoisClient;

app()->instance(WhoisClient::class, new readonly class extends WhoisClient
{
    public function query(string $server, string $domain): ?string
    {
        return "Registry Expiry Date: 2030-01-01T00:00:00Z\n";
    }
});
```

Testing
-------

[](#testing)

```
composer test      # pest
composer phpstan   # larastan, level 7
composer pint      # laravel preset
composer check     # all of the above
```

License
-------

[](#license)

MIT. See [LICENSE.md](LICENSE.md).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance100

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/151143718?v=4)[Lashyn Petro ](/maintainers/labrodev)[@labrodev](https://github.com/labrodev)

---

Tags

laraveldomainwhoisrdapexpirylabrodev

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/labrodev-laravel-domain-keeper/health.svg)

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

###  Alternatives

[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

813336.8k3](/packages/defstudio-telegraph)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1563.3k4](/packages/masterix21-laravel-licensing)

PHPackages © 2026

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