How do I change the domain when using URL::action()
laravel, laravel-4
Solution
Laravel 4 uses the Domain specified in the HTTP Request Header Field `Host`, e.g. `Host: http://foo.dev`.
If you want a different domain name, try something like this:
Route::group(array('domain' => 'bar.dev'), function()
{
Route::controller('home', 'HomeController');
});
Now `URL::action('HomeController@getWelcome');`returns `https://bar.dev/home/welcome` instead of `https://foo.dev/home/welcome`
Problem
I am trying to duplicate something that was available in Laravel 3. I want to be able to specify an alternate domain name for a route. For example, I have a route that produces the following with this code: ``` URL::action('DashboardController@something') // Produces: http://somedomain.com/dashboard/something ``` I want to be able to specify a different domain. This used to be in the config/application.php file as 'url'. This no longer works in L4. Is there a way to specify a base url to use whenever a URL is being constructed?