Bioinformatics Analyst at Seven Bridges & PhD Student at METU

Base URL for Your Laravel 4 Website

To get base URL of your website to generate links to your content or assets do following:

Set $url in app/config/app.php to your base URL:

'url' => 'http://localhost/example',

Use it everywhere with URL::to(), for example:

echo URL::to('assets/css/general.css');
/* outputs http://localhost/example/assets/css/general.css */