laravel-domain-parser
laravel-domain-parser copied to clipboard
How to use DomainParser facade?
Please provide examples.
Hi! Anything specific you would like to know about?
Even though this issue is related to #24, I'll leave it open until fixed.
Thank you Kevin. The idea of using the resolve()
method on what is presented as a "list" object wasn't obvious at all. Finally figured it out by cross-referencing the PDP documentation. I'll leave this here for others:
$pdp = app('pdp.rules')->resolve($raw_domain);
$registrable_domain = $pdp->registrableDomain()->toString();
$tld = $pdp->suffix()->toString();