Home Laravel How to Get Site URL in Laravel?

How to Get Site URL in Laravel?

by Shahriar Sagor

Today now in post i would like to share you how to get site url in laravel. Now here is a quick post, which can help you to get the base url or home page url of your laravel application. So I think many of times we need to get the site URL for the something share or link. so we can get that by using the url helper and URL facade. Both of way are same we can use that anywhere i mean in controller or view.

So let’s start and see the example.

$url = URL::to("/");

$url2 = url('/');

Read Also : How to convert Object into Array in PHP?

Thanks for read. I hope it help you. For more you can follow us on facebook.


You may also like