Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

realodix/urlhub

532 stars
2 code files
View realodix/urlhub on GitHub

composer.json

Open in GitHub
{
"require": {
"php": "^8.0",
//
"spatie/url": "^2.0",
},
}

app/Services/UrlService.php

Open in GitHub
use Spatie\Url\Url as SpatieUrl;
 
class UrlService
{
public function getDomain(string $url)
{
$url = SpatieUrl::fromString($url);
 
return urlSanitize($url->getHost());
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.