[Domain] DNS Management Improvements#1050
Merged
saeedvaziry merged 2 commits intovitodeploy:3.xfrom Mar 16, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the domain DNS management feature by adding MX priority support end-to-end (DB/model/API/provider/UI), centralizing DNS record validation, and improving frontend UX around copying values and provider-specific capabilities.
Changes:
- Added nullable
priorityto DNS records (migration/model/resource/actions/provider parsing/payload). - Refactored DNS record validation into
DNSRecordRulesand updated create/update actions to use it. - Frontend updates: provider-aware columns/proxy UI, TXT uses textarea, new clipboard hook + new copy UI patterns.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/DNSProviders/CloudflareTest.php | Expands unit coverage for Cloudflare record parsing including priority handling. |
| resources/js/types/index.d.ts | Extends provider config types with proxy_types and supports_created_at. |
| resources/js/types/dns-record.d.ts | Adds priority to the DNSRecord TS type. |
| resources/js/pages/domains/show.tsx | Builds record table columns dynamically based on provider config. |
| resources/js/pages/domains/components/record-form.tsx | Adds MX priority input, TXT textarea, manual TTL option, and provider-aware proxy toggle. |
| resources/js/pages/domains/components/record-columns.tsx | Refactors columns into getColumns, adds priority column, lock icon, and new copy UI. |
| resources/js/hooks/use-clipboard.ts | Introduces reusable clipboard hook with toast + copied state. |
| resources/js/components/copyable-badge.tsx | Migrates to useClipboard for shared clipboard behavior. |
| database/migrations/2026_03_16_201111_add_priority_to_dns_records_table.php | Adds nullable priority column to dns_records. |
| app/Providers/DNSProviderServiceProvider.php | Registers Cloudflare provider proxy/created-at capabilities. |
| app/Plugins/RegisterDNSProvider.php | Adds proxyTypes and supportsCreatedAt to provider registration/config output. |
| app/Models/Domain.php | Persists priority when syncing provider records into local DB. |
| app/Models/DNSRecord.php | Adds priority to fillable/casts and adjusts TTL formatting output. |
| app/Http/Resources/DNSRecordResource.php | Exposes priority in API/web JSON responses. |
| app/DNSProviders/Cloudflare.php | Parses/sends priority and refactors request payload building. |
| app/Actions/Domain/UpdateDNSRecord.php | Saves priority and uses centralized validation rules. |
| app/Actions/Domain/DNSRecordRules.php | Centralizes validation and adds priority constraints. |
| app/Actions/Domain/CreateDNSRecord.php | Saves priority and uses centralized validation rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for DNS record priority, refactors validation logic, and improves clipboard functionality in the frontend. The most significant changes are grouped below:
DNS Record Priority Support
priorityfield to thedns_recordstable via a migration and updated theDNSRecordmodel to include this property in fillable and cast arrays. [1] [2] [3] [4]priorityfield. This includes reading, saving, and passingprioritywhere applicable. [1] [2] [3] [4] [5]DNSRecordResourceto expose thepriorityfield in API responses.Validation Refactoring
DNSRecordRulesclass, centralizing and updating rules to include thepriorityfield.CreateDNSRecordandUpdateDNSRecordactions to use the new validation rules class. [1] [2]Cloudflare Provider Enhancements
buildPayloadmethod for creating/updating records, ensuring consistent handling of the newpriorityfield. [1] [2] [3]Frontend Clipboard Improvements
copyable-badge.tsxwith a reusableuseClipboardhook, and updated UI feedback. [1] [2]CopyableTextcomponent for improved clipboard handling and visual feedback. [1] [2]DNS Provider Registration Extensions
proxyTypesandsupportsCreatedAtconfiguration, updating relevant service provider and plugin logic. [1] [2] [3] [4]