{"id":17855350,"url":"https://github.com/arubacao/tld-checker","last_synced_at":"2025-04-05T23:10:32.776Z","repository":{"id":25703856,"uuid":"103976450","full_name":"arubacao/tld-checker","owner":"arubacao","description":"Top Level Domain (TLD) validation library for PHP","archived":false,"fork":false,"pushed_at":"2024-05-19T04:01:30.000Z","size":607,"stargazers_count":69,"open_issues_count":0,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-20T04:47:49.739Z","etag":null,"topics":["domain","iana","laravel","php","tld"],"latest_commit_sha":null,"homepage":"","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/arubacao.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-18T18:30:27.000Z","updated_at":"2024-06-02T05:19:43.870Z","dependencies_parsed_at":"2024-01-14T05:43:18.756Z","dependency_job_id":"ffce8614-6c29-469c-9bb1-62a6d001e913","html_url":"https://github.com/arubacao/tld-checker","commit_stats":{"total_commits":385,"total_committers":10,"mean_commits":38.5,"dds":"0.23376623376623373","last_synced_commit":"712838405527162e4b5f172b63096076df4c4fce"},"previous_names":[],"tags_count":291,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arubacao%2Ftld-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arubacao%2Ftld-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arubacao%2Ftld-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arubacao%2Ftld-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arubacao","download_url":"https://codeload.github.com/arubacao/tld-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411235,"owners_count":20934653,"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":["domain","iana","laravel","php","tld"],"created_at":"2024-10-28T02:03:54.183Z","updated_at":"2025-04-05T23:10:32.756Z","avatar_url":"https://github.com/arubacao.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Top Level Domain (TLD) validation library for PHP\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/arubacao/tld-checker.svg?style=flat-square)](https://packagist.org/packages/arubacao/tld-checker)\n[![Build Status](https://img.shields.io/travis/arubacao/tld-checker/master.svg?style=flat-square)](https://travis-ci.com/arubacao/tld-checker)\n[![Codecov](https://img.shields.io/codecov/c/github/arubacao/tld-checker.svg?style=flat-square)](https://codecov.io/gh/arubacao/tld-checker)\n[![Quality Score](https://img.shields.io/scrutinizer/g/arubacao/tld-checker.svg?style=flat-square)](https://scrutinizer-ci.com/g/arubacao/tld-checker)\n[![Total Downloads](https://img.shields.io/packagist/dt/arubacao/tld-checker.svg?style=flat-square)](https://packagist.org/packages/arubacao/tld-checker)\n\nThis package allows **validation** of **top level domains** against the official [The DNS Root Zone](https://www.iana.org/domains/root) database from [iana.org](https://www.iana.org/).  \nUse this to validate e.g. **domains** or **email addresses**.  \n\u003e [The DNS Root Zone](https://www.iana.org/domains/root) is the upper-most part of the DNS hierarchy, and involves delegating administrative responsibility of “top-level domains”, which are the last segment of a domain name, such as .com, .uk and .nz.\n\n*The database is stored [locally](src/RootZoneDatabase.php) and automatically updated for new database versions.*  \n\n## Installation\nInstall this package via composer:\n\n```bash\ncomposer require arubacao/tld-checker\n```\n\n#### Laravel\n\nIf you would like to use `arubacao/tld-checker` with the [Laravel Validator](https://laravel.com/docs/validation/latest), you must also register the service provider:  \n*(only required for Laravel `\u003c=5.4`, for Laravel `\u003e=5.5` [auto-discovery](composer.json#L36) is enabled.)*\n```PHP\n// config/app.php\n\n'providers' =\u003e [\n    // Other Service Providers\n    Arubacao\\TldChecker\\TldCheckerServiceProvider::class,\n],\n```\nNotes:  \n\n - `arubacao/tld-checker` is functional and fully [tested](https://travis-ci.com/arubacao/tld-checker) for PHP `7.0` - `8.0` \u0026 Laravel `5.0` - `8.x`.   \n## Usage\nCheck a TLD using `Validator::isTld()`:\n``` php\nuse Arubacao\\TldChecker\\Validator;\n\nValidator::isTld('com');        // true\nValidator::isTld('CN');         // true (case insensitiv)\nValidator::isTld('москва');     // true (works with internationalized domain name (IDN) | unicode)\nValidator::isTld('XN--CZRS0T'); // true (works with encoded IDN | 商店)\nValidator::isTld('.org');       // true (allows dot prefix)\nValidator::isTld('apricot');    // false\n```\n\nCheck if a string ends with a valid TLD using `Validator::endsWithTld()`:\n``` php\nuse Arubacao\\TldChecker\\Validator;\n\nValidator::endsWithTld('apple.com');                            // true\nValidator::endsWithTld('NEWS.CN');                              // true (case insensitiv)\nValidator::endsWithTld('müller.vermögensberater');              // true (works with internationalized domain name (IDN) | unicode)\nValidator::endsWithTld('xn--mller-kva.xn--vermgensberater-ctb');// true (works with encoded IDN | müller.vermögensberater)\nValidator::endsWithTld('farming.apricot');                      // false\n\n```\n\nThis package extends the [Laravel Validator](https://laravel.com/docs/validation/latest) with these 2 methods:\n  \n  - `is_tld`\n  - `ends_with_tld`\n \nUse them as follows:\n```PHP\n$request-\u003evalidate([\n    'tld' =\u003e 'required|is_tld',\n    'email' =\u003e 'required|ends_with_tld'\n]);\n```\n\n## Testing\n\n``` bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Credits\n\n- [Christopher Lass](https://github.com/arubacao)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farubacao%2Ftld-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farubacao%2Ftld-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farubacao%2Ftld-checker/lists"}