PHPackages                             community-sdks/domain-providers-laravel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. community-sdks/domain-providers-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

community-sdks/domain-providers-laravel
=======================================

Laravel bridge for community-sdks/domain-providers-php with DB-backed provider registry and TLD sync.

v1.0.3(1w ago)14MITPHPPHP ^8.2

Since Mar 10Pushed 1w agoCompare

[ Source](https://github.com/community-sdks/domain-providers-laravel)[ Packagist](https://packagist.org/packages/community-sdks/domain-providers-laravel)[ RSS](/packages/community-sdks-domain-providers-laravel/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

Domain Providers Laravel
========================

[](#domain-providers-laravel)

Laravel integration package for `community-sdks/domain-providers-php`.

This package provides the Laravel bridge layer for:

- database persistence of provider instances and discovered TLDs
- encrypted provider credentials/config storage
- DB-driven provider bootstrapping into a singleton runtime handler
- queued per-provider TLD sync jobs
- dispatch command + scheduler integration
- cache invalidation hooks for provider/TLD changes

It intentionally keeps provider/domain logic in the pure PHP package.

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

[](#installation)

```
composer require community-sdks/domain-providers-laravel
```

If developing in this mono-repo, the package already uses a local path repository to `../php`.

Publish config and migrations:

```
php artisan vendor:publish --tag=domain-providers-config
php artisan vendor:publish --tag=domain-providers-migrations
php artisan migrate
```

Configuration
-------------

[](#configuration)

Config file: `config/domain-providers.php`

Important settings:

- `auto_register_from_database`
- `tenancy.enabled`, `tenancy.column`, `tenancy.current_tenant_id`, `tenancy.include_global_providers`
- `cache.enabled`, `cache.key_prefix`, `cache.ttl_seconds`
- `sync.enabled`
- `sync.dispatch_cadence` (for scheduler cadence method, e.g. `everyFifteenMinutes`)
- `sync.minimum_interval_minutes` (default `1440`)
- `sync.queue_connection`, `sync.queue_name`
- `sync.dispatch_mode` (`queued` or `inline`)
- `sync.mark_missing_tlds_inactive`
- `sync.only_active_providers`
- `sync.only_tld_discovery_providers`
- `sync.register_scheduler`

### Environment Variables

[](#environment-variables)

- `DOMAIN_PROVIDERS_AUTO_REGISTER`
- `DOMAIN_PROVIDERS_TENANCY_ENABLED`
- `DOMAIN_PROVIDERS_TENANT_COLUMN`
- `DOMAIN_PROVIDERS_TENANT_ID`
- `DOMAIN_PROVIDERS_INCLUDE_GLOBAL_PROVIDERS`
- `DOMAIN_PROVIDERS_CACHE_ENABLED`
- `DOMAIN_PROVIDERS_CACHE_PREFIX`
- `DOMAIN_PROVIDERS_CACHE_TTL`
- `DOMAIN_PROVIDERS_SYNC_ENABLED`
- `DOMAIN_PROVIDERS_SYNC_DISPATCH_CADENCE`
- `DOMAIN_PROVIDERS_SYNC_MIN_INTERVAL_MINUTES`
- `DOMAIN_PROVIDERS_SYNC_QUEUE_CONNECTION`
- `DOMAIN_PROVIDERS_SYNC_QUEUE_NAME`
- `DOMAIN_PROVIDERS_SYNC_DISPATCH_MODE`
- `DOMAIN_PROVIDERS_SYNC_MARK_MISSING_INACTIVE`
- `DOMAIN_PROVIDERS_SYNC_ONLY_ACTIVE`
- `DOMAIN_PROVIDERS_SYNC_ONLY_DISCOVERY`
- `DOMAIN_PROVIDERS_SYNC_REGISTER_SCHEDULER`

Database Schema
---------------

[](#database-schema)

### `domain_providers`

[](#domain_providers)

- `id` UUID primary key
- `tenant_id` nullable string
- `name` string
- `driver` string
- `config` encrypted text (JSON encoded before encryption)
- `rules` nullable JSON (non-secret policy metadata)
- `priority` int
- `is_active` bool
- `last_tld_sync_at`, `last_tld_sync_status`, `last_tld_sync_error`, `last_tld_sync_duration_ms`
- `notes` nullable text
- timestamps

### `domain_provider_tlds`

[](#domain_provider_tlds)

- `id` UUID primary key
- `tenant_id` nullable string
- `domain_provider_id` UUID FK -&gt; `domain_providers.id`
- `extension` normalized TLD (`com`, `co.uk`, no leading dot)
- `price` nullable decimal placeholder
- `currency` nullable string
- `is_active` bool
- `synced_at` nullable timestamp
- `metadata` nullable JSON
- timestamps
- unique(`domain_provider_id`, `extension`)

Runtime Integration
-------------------

[](#runtime-integration)

The package registers `DomainProviders\Handler\DomainProviderHandler` as a **singleton**.

Build flow:

1. load active providers from DB
2. decrypt+decode config
3. normalize rules
4. resolve provider factory by `driver`
5. instantiate provider + provider config
6. register into handler with DB provider UUID key
7. apply preferred TLD mappings from rules

Container bindings:

- `DomainProviders\Handler\DomainProviderHandler`
- alias to `DomainProviders\Contract\DomainProviderInterface`

Reusable Actions
----------------

[](#reusable-actions)

TLD sync logic is implemented in a reusable action:

- `DomainProviders\Laravel\Actions\SyncDomainProviderTldsAction`

This action can be called directly from your own services/controllers/jobs:

```
$result = app(\DomainProviders\Laravel\Actions\SyncDomainProviderTldsAction::class)
  ->syncByProviderId($providerId, $tenantId);
```

`DomainProviderTldSyncService` remains available as a compatibility wrapper.

Provider Config Templates
-------------------------

[](#provider-config-templates)

To build provider-specific config forms (for example in Filament), resolve config templates by driver:

```
$camel = app(\DomainProviders\Laravel\Services\ProviderConfigResolver::class)
  ->resolveConfigTemplateForDriver('godaddy');

$snake = app(\DomainProviders\Laravel\Services\ProviderConfigResolver::class)
  ->resolveConfigTemplateForDriver('godaddy', true);
```

Templates are derived from the provider config constructor in `community-sdks/domain-providers-php`, so they stay aligned with package updates.

### Spaceship Config

[](#spaceship-config)

Store this in the encrypted `config` JSON for a `spaceship` provider row:

```
{
  "api_key": "your-key",
  "api_secret": "your-secret",
  "environment": "production"
}
```

Use `"environment": "sandbox"` for the Spaceship sandbox environment.

### GoDaddy Account Modes

[](#godaddy-account-modes)

GoDaddy now supports both reseller and direct account flows.

Store this in the encrypted `config` JSON for a `godaddy` provider row:

```
{
  "api_key": "your-key",
  "api_secret": "your-secret",
  "environment": "production",
  "account_mode": "reseller",
  "customer_id": "your-customer-id"
}
```

For direct API accounts (non-reseller), use:

```
{
  "api_key": "your-key",
  "api_secret": "your-secret",
  "environment": "production",
  "account_mode": "direct",
  "customer_id": null
}
```

Notes:

- `account_mode` defaults to `reseller` when omitted.
- `customer_id` is required in `reseller` mode.
- `customer_id` can be `null` in `direct` mode.

Rules Conventions
-----------------

[](#rules-conventions)

`rules` is for non-secret provider policy metadata (JSON), e.g.:

```
{
  "included_tlds": ["com", "net"],
  "excluded_tlds": ["xyz"],
  "priority_tlds": ["io"],
  "preferred_tlds": ["co.uk"]
}
```

TLD Sync
--------

[](#tld-sync)

Command:

```
php artisan domain-providers:sync-tlds-dispatch
```

Options:

- `--provider=` sync eligibility for one provider
- `--tenant=` optional tenant context override
- `--inline` execute sync inline (no queue dispatch)
- `--force` ignore due-time check

Queued job:

- `DomainProviders\Laravel\Jobs\SyncDomainProviderTldsJob`
- one job per provider
- checks active provider state
- updates provider sync status fields

Sync behavior:

- verifies provider supports TLD discovery interface
- normalizes discovered extensions
- upserts `domain_provider_tlds`
- updates `synced_at`
- marks missing known TLD rows inactive if enabled
- does not hard-delete missing rows by default

Cache Invalidation
------------------

[](#cache-invalidation)

`DomainProviderObserver` and `DomainProviderTldObserver` flush package caches on save/delete.

Testing
-------

[](#testing)

```
vendor/bin/phpunit
```

Current test coverage includes:

- encrypted config read/write behavior
- active provider resolution order
- singleton handler assembly
- TLD sync normalization/upsert/missing inactive behavior
- dispatch command due-provider selection

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance98

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity49

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

Every ~0 days

Total

4

Last Release

9d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/211412089?v=4)[ZPM Labs](/maintainers/zpmlabs)[@ZPMLabs](https://github.com/ZPMLabs)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/community-sdks-domain-providers-laravel/health.svg)

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

PHPackages © 2026

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