get domain name from url laravel code example
Example 1: laravel get current domain
request()->getHost();
Example 2: laravel get host with http
$host = $request->getSchemeAndHttpHost(); // returns https://dev.site.com
request()->getHost();
$host = $request->getSchemeAndHttpHost(); // returns https://dev.site.com