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("/"); print_r($url); $url2 = url('/'); print_r($url2);
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.