2
I remember that when I used the Codeigniter framework, I could find out what the base url of the application was by simply calling base_url()
. On Laravel 3, I wore URL::base()
.
But now, on the Laravel 5, when I called URL::base()
, returns the following error:
Badmethodcallexception with message 'Method base does not exist.'
I tested on Laravel 4, and the same error occurs.
So, what is the correct way to find out the base url of the application, using Laravel 4 or 5?
Good. I tested it here on
php artisan tinker
(Laravel 4) and it worked. But it didn’t even have to call the bar, just useurl()
.– Wallace Maxters