Ad

How To The Domain Url In Laravel5

- 1 answer

I have to get the domain url (ex. http://www.example.com/) in laravel blade. I've tried using {{ url() }} but it returns the path to my public directory. Is there any one line function to get this? How do I get the domain in blade? Need help. Thanks.

Ad

Answer

You can also try

{{ Request::server ("SERVER_NAME") }} {{ Request::server ("SERVER_NAME") }}

Or go with {{ Request::root() }}

Ad
source: stackoverflow.com
Ad