How to get domain root url in Laravel 4?
UPDATE (2017-07-12) A better solution is actually to use Request::getHost() Previous answer: I just checked and Request::root(); does return http://www.example.com in my case, no matter which route I’m on. You can then do the following to strip off the http:// part: if (starts_with(Request::root(), ‘http://’)) { $domain = substr (Request::root(), 7); // $domain is now ‘www.example.com’ … Read more