{"id":18578299,"url":"https://github.com/astrotomic/laravel-dns","last_synced_at":"2025-06-11T20:40:16.174Z","repository":{"id":62488926,"uuid":"369594434","full_name":"Astrotomic/laravel-dns","owner":"Astrotomic","description":"A Laravel wrapper for spatie/dns. Allows to query and validate DNS records.","archived":false,"fork":false,"pushed_at":"2023-08-29T09:32:16.000Z","size":79,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T02:22:02.152Z","etag":null,"topics":["dns","laravel","php"],"latest_commit_sha":null,"homepage":"https://github.com/spatie/dns","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Astrotomic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-05-21T16:29:31.000Z","updated_at":"2025-03-06T14:11:25.000Z","dependencies_parsed_at":"2022-11-02T11:01:07.508Z","dependency_job_id":"cb47ea43-520d-42e0-880a-2c62d3010755","html_url":"https://github.com/Astrotomic/laravel-dns","commit_stats":{"total_commits":27,"total_committers":3,"mean_commits":9.0,"dds":0.2592592592592593,"last_synced_commit":"ea7d91403c01d06e49ab8d5a8cf607133d76aacb"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astrotomic%2Flaravel-dns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astrotomic%2Flaravel-dns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astrotomic%2Flaravel-dns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Astrotomic%2Flaravel-dns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Astrotomic","download_url":"https://codeload.github.com/Astrotomic/laravel-dns/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199136,"owners_count":21063641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dns","laravel","php"],"created_at":"2024-11-06T23:34:32.936Z","updated_at":"2025-04-10T10:31:03.759Z","avatar_url":"https://github.com/Astrotomic.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel DNS\n\n[![Latest Version](http://img.shields.io/packagist/v/astrotomic/laravel-dns.svg?label=Release\u0026style=for-the-badge)](https://packagist.org/packages/astrotomic/laravel-dns)\n[![MIT License](https://img.shields.io/github/license/Astrotomic/laravel-dns.svg?label=License\u0026color=blue\u0026style=for-the-badge)](https://github.com/Astrotomic/laravel-dns/blob/master/LICENSE)\n[![Offset Earth](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-green?style=for-the-badge)](https://plant.treeware.earth/Astrotomic/laravel-dns)\n[![Larabelles](https://img.shields.io/badge/Larabelles-%F0%9F%A6%84-lightpink?style=for-the-badge)](https://www.larabelles.com/)\n\n![](https://img.shields.io/badge/PHP-^8.0-777BB4?style=for-the-badge\u0026logo=php\u0026logoColor=white)\n![](https://img.shields.io/badge/Laravel-^8.0-FF2D20?style=for-the-badge\u0026logo=laravel\u0026logoColor=white)\n\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/laravel-dns/pest?style=flat-square\u0026logoColor=white\u0026logo=github\u0026label=Tests)](https://github.com/Astrotomic/laravel-dns/actions?query=workflow%3Apest)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/laravel-dns/php-cs-fixer?style=flat-square\u0026logoColor=white\u0026logo=github\u0026label=Code+Style)](https://github.com/Astrotomic/laravel-dns/actions?query=workflow%3Aphp-cs-fixer)\n[![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/laravel-dns.svg?label=Downloads\u0026style=flat-square)](https://packagist.org/packages/astrotomic/laravel-dns)\n\n## Installation\n\n```bash\ncomposer require astrotomic/laravel-dns\n```\n\n## Usage\n\n```php\nuse Astrotomic\\Dns\\Facades\\Dns;\n\n/** @var \\Illuminate\\Support\\Collection $records */\n$records = Dns::records('astrotomic.info', DNS_A);\n```\n\n```php\nuse Astrotomic\\Dns\\Rules\\DnsRecordExists;\nuse Spatie\\Dns\\Records\\A;\nuse Spatie\\Dns\\Records\\TXT;\n\nreturn [\n    'url' =\u003e [\n        'required',\n        'string',\n        'url',\n        // verify that domain of entered url\n        // has any A, AAAA or CNAME record\n        // and a TXT record with the users token\n        DnsRecordExists::make()\n            -\u003eexpect(DNS_A|DNS_AAAA|DNS_CNAME)\n            -\u003eexpect(DNS_TXT, fn(TXT $record): bool =\u003e $record-\u003etxt() === 'token='.$this-\u003euser()-\u003epublic_token),\n    ],\n    'email' =\u003e [\n        'required',\n        'string',\n        'email',\n        // verify that domain of entered email\n        // has any MX record\n        // and SPF setup\n        DnsRecordExists::make()\n            -\u003eexpect(DNS_MX)\n            -\u003eexpect(DNS_TXT, fn(TXT $record): bool =\u003e str_starts_with($record-\u003etxt(), 'v=spf1 ')),\n    ],\n    'domain' =\u003e [\n        'required',\n        'string',\n        // verify that entered domain\n        // has an A record\n        // pointing to our IP-address\n        DnsRecordExists::make()\n            -\u003eexpect(DNS_A, fn(A $record): bool =\u003e $record-\u003eip() === '127.0.0.1'),\n    ],\n    'something' =\u003e [\n        'required',\n        'string',\n        // verify that value is something with DNS\n        DnsRecordExists::make(),\n    ],\n];\n```\n\n```php\nuse Astrotomic\\Dns\\Domain;\n\nprotected $casts = [\n    'domain' =\u003e Domain::class,\n];\n```\n\n```php\nuse Astrotomic\\Dns\\Domain;\n\n/** @var \\Astrotomic\\Dns\\Domain $domain */\n$domain = Domain::make('dns@astrotomic.info');\n\n/** @var string|null $domain */\n$domain = Domain::parse('dns@astrotomic.info');\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrotomic%2Flaravel-dns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrotomic%2Flaravel-dns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrotomic%2Flaravel-dns/lists"}