I faced the same issue and finally found the solution by using :
App::before(function($request)
{
if( (Request::header('x-forwarded-proto') <> 'https') && !App::environment('local', 'staging')) {
return Redirect::secure(Request::getRequestUri());
}
});
It was due to Heroku passing this information in a different variable than the one used by default by Laravel.
And if you are interested in getting the right environment detection, this is what I used with Laravel and Heroku :
$env = $app->detectEnvironment(function() {
if (getenv('LARAVEL_ENV')) {
return getenv('LARAVEL_ENV');
} else {
return 'local'; // Default
}
});
You will need to set a "LARAVEL_ENV" environment variable in your different servers with local, staging or production.
With the two, only HTTPS traffic is forced on the production environment.