How can I get the base url or home url of the Laravel application ?
Asked
Active
Viewed 9.7k times
28
-
http://stackoverflow.com/a/16807843/552116 – Ghostman Apr 07 '15 at 04:41
-
@FyodorX sorry my bad i have deleted it – Veerendra Apr 07 '15 at 04:45
1 Answers
67
You can get the base url of the Laravel application by:
echo url('/');
or
{{ url('/') }}
Read more about Laravel helpers here
Oscar Gallardo
- 2,240
- 3
- 27
- 47
Sulthan Allaudeen
- 11,330
- 12
- 48
- 63
-
13On Laravel 5.2 later, you can't use just url(). Instead, use url('/'). https://github.com/laravel/framework/pull/10934 – mul14 Nov 17 '15 at 10:54